package com.ss.android.article.base.feature.detail2.article;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.webkit.DownloadListener;
import android.webkit.WebBackForwardList;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.AbsListView;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.bytedance.article.common.a.MonitorFPS;
import com.bytedance.article.common.c.JSONObjectWrapper;
import com.bytedance.article.common.c.TTUtils;
import com.bytedance.common.b.UserAgentCompat;
import com.bytedance.common.b.WebViewPauseResumeCompat;
import com.bytedance.common.utility.Logger;
import com.bytedance.common.utility.NetworkType;
import com.bytedance.common.utility.UIUtils;
import com.bytedance.common.utility.collection.WeakHandler;
import com.bytedance.frameworks.base.mvp.Presenter;
import com.ss.android.account.Spipe;
import com.ss.android.account.e.AccountAnimatorHelper;
import com.ss.android.account.e.MuteQuickClickListener;
import com.ss.android.action.ArticleActionHelper;
import com.ss.android.action.a.a.Comment;
import com.ss.android.action.a.c.ShareDialog;
import com.ss.android.action.b.ImpressionHelper;
import com.ss.android.article.base.ImageProvider;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.app.BizApplication;
import com.ss.android.article.base.feature.app.a.ArticleConstants;
import com.ss.android.article.base.feature.app.b.DBHelper;
import com.ss.android.article.base.feature.app.d.ImpressionListAdapter;
import com.ss.android.article.base.feature.app.schema.AdsAppActivity;
import com.ss.android.article.base.feature.detail.model.ArticleDetail;
import com.ss.android.article.base.feature.detail.model.ArticleInfo;
import com.ss.android.article.base.feature.detail.model.CommentWrapper;
import com.ss.android.article.base.feature.detail.model.PhoneAdsData;
import com.ss.android.article.base.feature.detail.presenter.ActivityStackManager;
import com.ss.android.article.base.feature.detail.presenter.ArticleTabComment;
import com.ss.android.article.base.feature.detail.presenter.ArticleTabCommentsRequestTask;
import com.ss.android.article.base.feature.detail.presenter.CommentFetcher;
import com.ss.android.article.base.feature.detail.presenter.CommentTabCache;
import com.ss.android.article.base.feature.detail.presenter.DetailHelper;
import com.ss.android.article.base.feature.detail.view.DetailScrollView;
import com.ss.android.article.base.feature.detail2.SSPage;
import com.ss.android.article.base.feature.detail2.article.a.NewDetailPageExtra;
import com.ss.android.article.base.feature.detail2.article.a.NewDetailViewHolder;
import com.ss.android.article.base.feature.detail2.article.b.ArticleDetailCommentPresenter;
import com.ss.android.article.base.feature.detail2.article.c.NewDetailView;
import com.ss.android.article.base.feature.detail2.b.NewDetailAdapter;
import com.ss.android.article.base.feature.detail2.c.NewArticleDetailTTAndroidObject;
import com.ss.android.article.base.feature.detail2.config.DetailStyleConfig;
import com.ss.android.article.base.feature.detail2.d.DetailLoadResultHandler;
import com.ss.android.article.base.feature.detail2.d.NewDetailContext;
import com.ss.android.article.base.feature.detail2.event.ThumbPreviewStatusEvent;
import com.ss.android.article.base.feature.detail2.view.NewDetailActivity;
import com.ss.android.article.base.feature.detail2.widget.DetailTitleBar;
import com.ss.android.article.base.feature.detail2.widget.SerialCatalogView;
import com.ss.android.article.base.feature.detail2.widget.m;
import com.ss.android.article.base.feature.feed.FeedTab;
import com.ss.android.article.base.feature.model.Article;
import com.ss.android.article.base.feature.model.CellRef;
import com.ss.android.article.base.feature.model.DownloadAppAd;
import com.ss.android.article.base.feature.pgc.PgcActivity;
import com.ss.android.article.base.feature.splash.SplashAdActivity;
import com.ss.android.article.base.feature.subscribe.b.SubscribeManager;
import com.ss.android.article.base.feature.update.a.UserInfo;
import com.ss.android.article.base.feature.update.b.UpdateItemMgr;
import com.ss.android.article.base.feature.video.IVideoController;
import com.ss.android.article.base.feature.video.IVideoControllerContext;
import com.ss.android.article.base.feature.video.IVideoFullscreen;
import com.ss.android.article.base.ui.DiggAnimationView;
import com.ss.android.article.base.ui.NoDataViewFactory$ImgType;
import com.ss.android.article.base.ui.ScrollListenerWebView;
import com.ss.android.article.base.utils.ArticleHelper;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.ThumbPreviewActivity;
import com.ss.android.article.common.e.VideoControllerSupplierProxy;
import com.ss.android.b.a.BaseAdsData;
import com.ss.android.common.ad.MobAdClickCombiner;
import com.ss.android.common.app.IComponent;
import com.ss.android.common.app.WebViewTweaker;
import com.ss.android.common.applog.AppLog;
import com.ss.android.common.callback.CallbackCenter;
import com.ss.android.common.callback.SSCallback;
import com.ss.android.common.dialog.AlertDialog;
import com.ss.android.common.lib.MobClickCombiner;
import com.ss.android.common.ui.view.FullscreenVideoFrame;
import com.ss.android.common.ui.view.SwipeOverlayFrameLayout;
import com.ss.android.common.util.AnimatorUtil;
import com.ss.android.common.util.LoadUrlUtils;
import com.ss.android.common.util.NetworkUtils;
import com.ss.android.common.util.ToolUtils;
import com.ss.android.image.loader.LargeImageCtxRef;
import com.ss.android.image.model.ImageInfo;
import com.ss.android.messagebus.Subscriber;
import com.ss.android.messagebus.SubscriptionRouter;
import com.ss.android.model.AbsArticle;
import com.ss.android.model.BaseArticle;
import com.ss.android.model.ItemType;
import com.ss.android.newmedia.BaseAppData;
import com.ss.android.newmedia.MediaAppUtil;
import com.ss.android.newmedia.a.AbstractFooter;
import com.ss.android.newmedia.a.AdsAppBaseActivity;
import com.ss.android.newmedia.a.w;
import com.ss.android.newmedia.e.WapStatHelper;
import com.ss.android.newmedia.f.Response;
import com.ss.android.newmedia.util.AppUtil;
import com.ss.android.newmedia.util.InfoLRUCache;
import com.ss.android.newmedia.webview.SSWebSettings;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import im.quar.autolayout.utils.AutoUtils;

public class NewArticleDetailFragment extends com.bytedance.article.a.a.c<ArticleDetailCommentPresenter> implements
        WeakHandler.Callback,
        ShareDialog.b$a,
        ImageProvider.OnRemoteImageLoadedListener,
        com.ss.android.article.base.feature.detail.presenter.a,
        DetailHelper.SimpleArticle,
        NewDetailView,
        NewDetailAdapter.a$a,
        SSPage,
        m,
        IVideoControllerContext,
        LargeImageCtxRef,
        w {
    private static String TAG = NewArticleDetailFragment.class.getSimpleName();
    final WeakHandler mWeakHandler = new WeakHandler(this);
    private final Map<String, ImpressionListAdapterItem> mImpressionListAdapterItemMap = new HashMap();
    private final Map<String, NewArticleDetailFragment$a> aT = new HashMap();
    protected IVideoController mVideoController;
    protected Context mContext;
    int A = 0;
    NewDetailContext mNewDetailContext;
    int articlePosition;
    Runnable mDelayFinishRunnable;
    int[] E;
    com.ss.android.article.base.ui.NoNetView mNoNetView;
    ImpressionListAdapter mImpressionListAdapter;
    int mWebContainerAnimState = 0;
    BaseArticle c;
    long itemId;
    Article mArticle;
    AppData mAppData;
    ViewGroup mRootView;
    SerialCatalogView mSerialCatalogView;
    ArticleActionHelper mArticleActionHelper;
    NewDetailViewHolder mNewDetailViewHolder;
    boolean isUserSwipeBack = false;
    DetailHelper mDetailHelper;
    boolean o;
    boolean p;
    IVideoFullscreen mVideoFullscreenDelegate;
    boolean r;
    boolean isTitleBarPgcLayoutShow;
    boolean t;
    boolean u = false;
    long mPostDelayFinishTs;
    MonitorFPS mDetailArticleMonitorFPS;
    MonitorFPS DetailArticleCommentMonitorFPS;
    boolean z;
    private boolean I = true;
    private long J = 0;
    private long K = 0;
    private String mLogExtra;
    private long articleGroupItemId;
    private int mArticleAggrType;
    private String mLandingPageUrl;
    private String mCategoryName;
    private boolean mIsNightMode = false;
    private SwipeOverlayFrameLayout mSwipeOverlayFrameLayout;
    private Resources mResources;
    private ProgressBar mProgressBar;
    private boolean U;
    private FrameLayout mTopVideoHolder;
    private DiggAnimationView mDiggAnimationView;
    private FrameLayout mWebContainer;
    private boolean mDisableDetailFragmentPreload;
    private boolean Z = true;
    private IVideoController.IPlayCompleteListener mPlayCompleteListener;
    private String mCustomUserAgent = null;
    private String mOriginUserAgent;
    private int mFontSizePref;
    private InfoLRUCache<Long, CommentTabCache> mInfoLRUCache;
    private boolean disableInfoLayer;
    private int aG;
    private boolean aH = false;
    private boolean isWebViewDataLoaded = false;
    private boolean isDetailCommentsShowReported = false;
    private ArrayList<CommentWrapper> mCommentList = new ArrayList();
    private RecordManager mRecordManager;
    private boolean isArticleDetailLoading;
    private boolean hasNovelLastReadPosition;
    private long aO;
    private boolean isCommentModeReported = false;
    private long aQ;
    private ValueAnimator mScrollWebViewAnimator;
    private IVideoFullscreen mVideoFullscreen;
    private Spipe mSpipe;
    private long mItemId = 0;
    private long mCommentId = 0;
    private boolean ad = false;
    private boolean ae = false;
    private boolean mFromNotification = false;
    private boolean isClickBackBtn = false;
    private boolean isCloseButtonClick = false;
    private FullscreenVideoFrame mFullscreenVideoFrame;
    private View mCustomView;
    private WebChromeClient.CustomViewCallback mCustomViewCallback;
    private boolean mAllowHtmlVideo = true;
    private String mVid;
    private int an;
    private int ao;
    private int ap;
    private String aq;
    private String mArticleUrl;
    private boolean as;
    private Map at = new HashMap();
    private boolean au;
    private boolean av;
    private boolean aw;
    private IVideoController.ICloseListener mVideoCloseListener;
    private SSCallback addArticleCommentFromUpdateCallback;
    private SSCallback articleSubOrUnsubCallback;

    public NewArticleDetailFragment() {
        this.mVideoCloseListener = new IVideoController.ICloseListener() {
            @Override
            public final void onClose(boolean arg2) {
                if (!NewArticleDetailFragment.this.isFinishing()) {
                    if (arg2) {
                        NewArticleDetailFragment.this.onBack();
                    } else {
                        if (NewArticleDetailFragment.this.mVideoController != null && (NewArticleDetailFragment.this.mVideoController.isVideoVisible())) {
                            NewArticleDetailFragment.this.mVideoController.releaseMedia();
                        }
                        NewArticleDetailFragment.this.onVideoClose();
                    }
                }
            }
        };
        this.addArticleCommentFromUpdateCallback = new SSCallback() {
            @Override
            public final Object onCallback(Object[] args) {
                if (args[0] == BaseAppData.callbackTypeAddArticleCommentFromUpdate) {
                    long v2 = ((Long) args[1]).longValue();
                    Comment comment = (Comment) args[2];
                    if (v2 == NewArticleDetailFragment.this.itemId) {
                        NewArticleDetailFragment.this.a(comment);
                    }
                }
                return null;
            }
        };
        this.articleSubOrUnsubCallback = new SSCallback() {
            @Override
            public final Object onCallback(Object[] args) {
                if (args[0] == BaseAppData.callbackTypeArticleSubOrUnsub && (AppData.getInstance().getAbSettings().isAppLogNew())) {
                    boolean follow = ((Boolean) args[1]).booleanValue();
                    JSONObject jsonObject = new JSONObject();
                    try {
                        if (NewArticleDetailFragment.this.mArticle != null) {
                            jsonObject.put("to_user_id", NewArticleDetailFragment.this.mArticle.getUserId());
                        }

                        jsonObject.put("follow_type", "from_group");
                        jsonObject.put("source", "article_detail");
                        jsonObject.put("server_source", 30);
                        jsonObject.put("position", "title_below");
                    } catch (JSONException jsonException) {
                    }
                    String event = follow ? "rt_follow" : "rt_unfollow";
                    NewArticleDetailFragment.this.reportArticleSubOrUnsub(event, jsonObject, NewArticleDetailFragment.this.c);
                }
                return null;
            }
        };
        this.mPlayCompleteListener = new IVideoController.IPlayCompleteListener() {
            public final void onItemShare(int channel) {
                if (channel <= 0) {
                    return;
                }

                IVideoController videoController = NewArticleDetailFragment.this.getVideoController();
                String fullScreen = "notfullscreen";
                if (videoController != null) {
                    fullScreen = videoController.isFullScreen() ? "fullscreen" : "notfullscreen";
                }

                JSONObject jo = new JSONObject();
                try {
                    jo.put("source_type", "video");
                    jo.put("section", "detail_video_over");
                    jo.put("fullscreen", fullScreen);
                    jo.put("icon_seat", "exposed");
                } catch (JSONException jsonException) {
                }

                NewDetailActivity newDetailActivity = (NewDetailActivity) NewArticleDetailFragment.this.getActivity();
                switch (channel) {
                    case 1: {
                        newDetailActivity.shareToMoment("detail", jo);
                        return;
                    }
                    case 2: {
                        newDetailActivity.shareToWeChat("detail", jo);
                        return;
                    }
                    case 3: {
                        newDetailActivity.shareToQQ("detail", jo);
                        return;
                    }
                }

                return;
            }

            public final void onReplay() {
            }

            public final void onShare() {
                ((NewDetailActivity) NewArticleDetailFragment.this.getActivity()).onShare();
            }
        };
        this.mDelayFinishRunnable = new Runnable() {
            @Override
            public final void run() {
                if ((NewArticleDetailFragment.this.u) || System.currentTimeMillis() - NewArticleDetailFragment.this.mPostDelayFinishTs > 1500) {
                    NewArticleDetailFragment.this.u = true;
                    NewArticleDetailFragment.this.finishPage();
                } else {
                    NewArticleDetailFragment.this.mWeakHandler.removeCallbacks(NewArticleDetailFragment.this.mDelayFinishRunnable);
                    NewArticleDetailFragment.this.mWeakHandler.postDelayed(NewArticleDetailFragment.this.mDelayFinishRunnable, 100);
                }
            }
        };
        this.mVideoFullscreen = new IVideoFullscreen() {
            @Override
            public final void onFullscreenChanged(boolean arg3) {
                if (!NewArticleDetailFragment.this.isFinishing() && NewArticleDetailFragment.this.getCommentMode() == 0) {
                    NewDetailActivity newDetailActivity = (NewDetailActivity) NewArticleDetailFragment.this.getActivity();
                    boolean detailBarVisible = !arg3;
                    newDetailActivity.setDetailToolBarVisible(detailBarVisible);
                }

                if (NewArticleDetailFragment.this.mVideoFullscreenDelegate != null) {
                    NewArticleDetailFragment.this.mVideoFullscreenDelegate.onFullscreenChanged(arg3);
                }
            }
        };
    }

    private static void a(List<CommentWrapper> commentWrapperList) {
        if (commentWrapperList != null && commentWrapperList.size() != 0) {
            int v1;
            for (v1 = 0; v1 < commentWrapperList.size(); ++v1) {
                CommentWrapper commentWrapper = commentWrapperList.get(v1);
                commentWrapper.e = 0;
                if (commentWrapper.cellType != 1 && v1 > 0) {
                    commentWrapper = commentWrapperList.get(v1 - 1);
                    if (commentWrapper.cellType == 1) {
                        commentWrapper.e = 1;
                    }
                }

                if (v1 == commentWrapperList.size() - 1) {
                    commentWrapperList.get(v1).e = 2;
                }
            }
        }
    }

    static void b(NewDetailViewHolder arg2) {
        if (arg2 != null && arg2.mListView != null && arg2.mNewDetailAdapter != null && !arg2.mDetailScrollView.g) {
            arg2.mNewDetailAdapter.a(arg2.mDetailScrollView.getScrollY());
        }
    }

    private static String i(String url) {
        if (android.support.design.a.isTextEmpty(url)) {
            url = null;
        } else {
            int fromIndex = url.indexOf('#');
            if (fromIndex > 0) {
                int v1 = url.indexOf("tt_font=", fromIndex);
                if (v1 == fromIndex + 1) {
                    url = url.substring(0, fromIndex);
                } else if (v1 > fromIndex) {
                    v1 = url.indexOf("&tt_font=", fromIndex);
                    if (v1 > fromIndex) {
                        url = url.substring(0, v1);
                    }
                }
            }

            if (!url.startsWith("file:///android_asset/article/")) {
                return url;
            }

            int index = url.indexOf("&token=");
            if (index <= 0) {
                return url;
            }
            url = url.substring(0, index);
        }

        return url;
    }

    public final void onUserClickCloseBtn() {
        this.isCloseButtonClick = true;
        this.finishPage();
    }

    public final void onInfoBackClick() {
        this.R();
    }

    public final void onWriteCommentClick() {
        this.onEvent("write_button");
        this.r();
    }

    public final void onCommentLayoutClick() {
        this.a(false, 4, false);
    }

    public final void onFavorBtnClick() {
    }

    public final void onShare() {
    }

    final void enterComment() {
        if (mNewDetailViewHolder != null) {
            if (mArticle == null) {
                mNewDetailViewHolder.mFooter.hideFooterContent();
            } else {
                boolean everEnterComment = mNewDetailViewHolder.everEnterComment;
                mNewDetailViewHolder.everEnterComment = true;
                CommentTabCache commentTabCache = this.createCommentTabCache(mArticle.groupId, mNewDetailViewHolder);
                if (!commentTabCache.load[0]) {
                    ArticleTabComment articleTabComment = commentTabCache.mArticleTabComments[0];
                    if (!articleTabComment.hasComment) {
                        if (NetworkUtils.isNetworkAvailable(this.mContext)) {
                            CommentFetcher commentFetcher = new CommentFetcher(commentTabCache.mArticleTabComments[0].increateCounter(), mArticle, 0, 0, 0L);
                            this.mPresenter.loadComment(commentFetcher.getItemKey(), commentFetcher);
                            commentTabCache.load[0] = true;
                            mNewDetailViewHolder.mFooter.switchToLoading();
                            this.loadMultiTabComment(0L);
                        } else {
                            this.checkNetworkAndShowNoNetView();
                        }
                    } else if (mArticle.groupId != commentTabCache.itemId) {
                        mNewDetailViewHolder.mFooter.hideFooterContent();
                    } else {
                        if (!everEnterComment && mNewDetailViewHolder.mNewDetailAdapter.hasComments()) {
                            this.showCommentListOrSofa(mNewDetailViewHolder, commentTabCache);
                            if (!mNewDetailViewHolder.isDetailCommentsShowReported) {
                                mNewDetailViewHolder.isDetailCommentsShowReported = true;
                                this.reportEvent("enter_comment", mArticle, this.mNewDetailContext.adId);
                            }
                            return;
                        }
                        if (articleTabComment.isEmpty()) {
                            mNewDetailViewHolder.mFooter.hideFooterContent();
                            return;
                        }

                        if (commentTabCache.load[0]) {
                            mNewDetailViewHolder.mFooter.switchToLoading();
                            return;
                        }

                        if (!NetworkUtils.isNetworkAvailable(this.mContext)) {
                            this.checkNetworkAndShowNoNetView();
                            return;
                        }

                        MobClickCombiner.onEvent(this.getContext(), "detail", "comment_loadmore");
                        commentTabCache.load[0] = true;
                        mNewDetailViewHolder.mFooter.switchToLoading();
                        new ArticleTabCommentsRequestTask(this.mContext,
                                this.mWeakHandler,
                                new CommentFetcher(
                                        articleTabComment.increateCounter(),
                                        mArticle,
                                        0,
                                        articleTabComment.offset,
                                        0L))
                                .start();
                        if (!mNewDetailViewHolder.isFinishCommentReported) {
                            mNewDetailViewHolder.isFinishCommentReported = true;
                            this.reportEvent("finish_comment", mArticle, this.mNewDetailContext.adId);
                        }
                    }
                }
            }
        }
    }

    public final void hideProgressBar() {
        if (!this.isFinishing()) {
            try {
                Animation animation = AnimationUtils.loadAnimation(this.mContext, android.R.anim.fade_out);
                if (this.mProgressBar.getVisibility() != View.VISIBLE) {
                    return;
                }
                this.mProgressBar.startAnimation(animation);
                this.mProgressBar.setVisibility(View.GONE);
            } catch (Throwable throwable) {
            }
        }
    }

    public final void client_onHideCustomView() {
        if (this.mCustomView == null) {
            this.mCustomViewCallback = null;
            return;
        }

        try {
            this.mFullscreenVideoFrame.setVisibility(View.GONE);
            this.mFullscreenVideoFrame.removeView(this.mCustomView);
            UIUtils.requestActivityOrientation(this.getActivity(), false);
            if (!this.isFinishing()) {
                if (this.getCommentMode() == 0) {
                    ((NewDetailActivity) this.getActivity()).setDetailToolBarVisible(true);
                }

                if (((NewDetailActivity) this.getActivity()).mDetailTitleBar.getVisibility() == View.GONE) {
                    ((NewDetailActivity) this.getActivity()).setDetailTitleBarVisible(true);
                }
            }
            this.mCustomView = null;
            this.mCustomViewCallback.onCustomViewHidden();
        } catch (Throwable throwable) {
            Logger.e(NewArticleDetailFragment.TAG, "exception in : client_onHideCustomView : " + throwable.toString());
        }
    }

    final NewArticleDetailFragment$a J() {
        Object v0_1;
        NewArticleDetailFragment$a v0;
        String v1 = this.aa();
        if (v1 == null) {
            return null;
        } else {
            v0_1 = this.aT.get(v1);
            if (v0_1 == null) {
                v0 = new NewArticleDetailFragment$a();
                v0.url = v1;
                v0.e = this.aT.size();
                this.aT.put(v1, v0);
            }
        }
        return ((NewArticleDetailFragment$a) v0_1);
    }

    public final void K() {
        int v0 = 0;
        this.f("");
        if (this.mImpressionListAdapter != null) {
            this.mImpressionListAdapter.onPause();
        }

        int v1 = this.getSwipeOverlayHeight();
        int v2 = this.getContentHeight();
        NewArticleDetailFragment$a v3 = this.J();
        if (v3 != null) {
            int v4 = v3.maxscrollheight;
            if (v1 != 0 && v2 != 0) {
                float v4_1 = (((float) (v4 + v1))) / (((float) v2));
                int v5 = v2 / v1;
                if (v2 % v1 != 0) {
                    v0 = 1;
                }

                v3.screencount = v0 + v5;
                v3.precentage = Math.max(v3.precentage, v4_1);
                return;
            }

            v3.screencount = 0;
            v3.precentage = 0f;
        }
    }

    public final boolean L() {
        return this.o;
    }

    public final Activity customGetActivity() {
        return super.getActivity();
    }

    private void showCloseAllWebpageIv() {
        if (!this.isFinishing()) {
            ((NewDetailActivity) this.getActivity()).mDetailTitleBar.showCloseAllWebpageIv();
        }
    }

    private void O() {
        long v2 = 0;
        Article v0 = this.mArticle;
        if (this.I) {
            if (v0 != null && this.mNewDetailViewHolder != null && (this.mNewDetailViewHolder.m)) {
                this.J = System.currentTimeMillis();
                this.c = new BaseArticle(v0.groupId, v0.itemId, v0.aggrType);
                this.K = this.mNewDetailContext.adId;
                this.initDetailTitleBar(v0);
                return;
            }

            this.J = v2;
            this.c = null;
            this.K = v2;
        } else {
            this.I = true;
        }
        this.initDetailTitleBar(v0);
    }

    private void P() {
        JSONObject v0_2;
        JSONObject v6;
        String v8 = null;
        long v10 = 0;
        if (this.c != null && this.c.groupId > v10 && this.J > v10) {
            long v4 = System.currentTimeMillis() - this.J;
            if (v4 <= 3000) {
                return;
            }

            if (this.K > v10) {
                try {
                    v6 = new JSONObject("{\"ad_id\":" + this.K + "}");
                } catch (Exception v0) {
                    v6 = null;
                }
            } else {
                v6 = null;
            }

            if (AppData.getInstance().getAbSettings().isAppLogOld()) {
                this.report("stay_page", this.c, v4, v6);
            }

            if (AppData.getInstance().getAbSettings().isAppLogNew()) {
                if (v6 == null) {
                    v0_2 = new JSONObject();
                } else {
                    v0_2 = v6;
                }

                try {
                    v0_2.put("stay_time", v4);
                } catch (JSONException v1) {
                }

                label_43:
                this.reportArticleSubOrUnsub("stay_page", v0_2, this.c);
            }

            if (this.mNewDetailViewHolder != null && this.mNewDetailContext.adId > v10) {
                JSONObject v9 = new JSONObject();
                try {
                    v9.put("log_extra", this.mLogExtra);
                } catch (JSONException v0_1) {
                    v0_1.printStackTrace();
                }

                WapStatHelper.a(this.getActivity(), v4, this.mNewDetailContext.adId, v8, v9);
            }

            if (this.K > v10) {
                this.reportEvent("stay_page2", this.c, this.K);
            }
        }
    }

    private void Q() {
        if ((this.as) && !this.mArticle.ignoreWebTransform) {
            this.mArticle.articleType = 1;
            this.as = false;
        }
    }

    private void R() {
        if (!this.isFinishing()) {
            if (mNewDetailViewHolder != null) {
                if (mNewDetailViewHolder.mNewDetailAdapter.h) {
                    mNewDetailViewHolder.mNewDetailAdapter.h = false;
                }

                if ((mNewDetailViewHolder.mDetailScrollView.c) && this.mArticle != null && this.mArticle.commentCount == 0) {
                    this.r();
                }

                this.aw = mNewDetailViewHolder.mDetailScrollView.handleOpenDrawer(true);
                if (!this.aw) {
                    this.t = false;
                }

                if (mNewDetailViewHolder.mDetailScrollView.getVisibility() != View.VISIBLE) {
                    return;
                }

                if (!this.aw) {
                    return;
                }

                if (mNewDetailViewHolder.everEnterComment) {
                    return;
                }

                mNewDetailViewHolder.everEnterComment = true;
                if (!mNewDetailViewHolder.mNewDetailAdapter.hasComments()) {
                    return;
                }

                if (mNewDetailViewHolder.mCommentTabCache == null) {
                    return;
                }

                this.showCommentListOrSofa(mNewDetailViewHolder, mNewDetailViewHolder.mCommentTabCache);
            }
        }
    }

    private void handleExtraPage() {
        if (this.mArticle != null && this.mNewDetailViewHolder != null) {
            switch (this.getCommentMode()) {
                case 1:
                case 2: {
                    if (!this.isFinishing()) {
                        ((NewDetailActivity) this.getActivity()).setDetailToolBarVisible(false);
                    }
                    this.mNewDetailViewHolder.mFooter.hideFooterContent();
                    this.mNewDetailViewHolder.mNewDetailPageExtra.setContentsVisibility(View.GONE);
                    this.mNewDetailViewHolder.mNewDetailAdapter.addAllComment((List<CommentWrapper>) null);
                    this.mNewDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                    break;
                }
                default: {
                    if (!this.isFinishing()) {
                        ((NewDetailActivity) this.getActivity()).setDetailToolBarVisible(true);
                    }

                    this.mNewDetailViewHolder.mNewDetailPageExtra.setContentsVisibility(View.VISIBLE);
                    if (this.mNewDetailViewHolder.mCommentTabCache == null) {
                    } else {
                        this.showCommentListOrSofa(this.mNewDetailViewHolder, this.mNewDetailViewHolder.mCommentTabCache);
                        break;
                    }
                }
            }
            if (!this.isCommentModeReported) {
                this.isCommentModeReported = true;
                String mode = "";
                switch (mArticle.getCommentMode()) {
                    case 1: {
                        mode = "no_comments_mode";
                        break;
                    }
                    case 2: {
                        mode = "hide_mode";
                        break;
                    }
                }
                if (!android.support.design.a.isTextEmpty(mode) && mArticle != null && mArticle.groupId > 0L) {
                    JSONObject jsonObject = new JSONObject();
                    try {
                        jsonObject.put("item_id", mArticle.itemId);
                        jsonObject.put("aggr_type", mArticle.aggrType);
                    } catch (JSONException jsonException) {
                    }

                    MobClickCombiner.onEvent(this.getContext(), "detail", mode, mArticle.groupId, 0L, jsonObject);
                }
            }
        }
    }

    private int getDetailTitleBarHeight() {
        return this.isFinishing()
                ? 0
                : ((NewDetailActivity) this.getActivity()).getDetailTitleBarHeight();
    }

    private int getContentHeight() {
        return this.mNewDetailViewHolder == null || this.mNewDetailViewHolder.mWebView == null
                ? 0
                : (int) (UserAgentCompat.getScale(this.mNewDetailViewHolder.mWebView) * (float) this.mNewDetailViewHolder.mWebView.getContentHeight());
    }

    private void V() {
        int v1 = 0;
        int v0 = 1;
        if (mNewDetailViewHolder != null
                && mNewDetailViewHolder.mNightModeOverlay != null) {
            if (!mNewDetailViewHolder.isNightMode) {
                mNewDetailViewHolder.mNightModeOverlay.setVisibility(View.INVISIBLE);
            } else {
                if (mArticle != null) {
                    if (mArticle.hasArticleUrl()) {
                        if (mNewDetailViewHolder.m) {
                            if (!mArticle.d()) {
                            } else {
                                v0 = 0;
                            }
                        } else if (!mArticle.d()) {

                        } else {
                            v0 = 0;
                        }
                    } else {
                        v0 = 0;
                    }

                    v0 = 0;
                }
                if (v0 == 0) {
                    v1 = 4;
                }
                mNewDetailViewHolder.mNightModeOverlay.setVisibility(v1);
            }
        }
    }

    private String getEnterFrom() {
        return this.mPresenter.mNewDetailContext.getEnterFrom();
    }

    private void checkNetworkAndShowNoNetView() {
        if (this.mNewDetailViewHolder != null
                && this.mNewDetailViewHolder.mFooter != null
                && this.mNewDetailViewHolder.mFooter.mFooterContent != null
                && !NetworkUtils.isNetworkAvailable(this.getContext())) {
            if (this.mNoNetView == null) {
                this.mNoNetView = android.support.design.a.a(this.getContext(), this.mNewDetailViewHolder.mFooter.mFooterContent,
                        com.ss.android.article.base.ui.ac.a(NoDataViewFactory$ImgType.NOT_NETWORK),
                        com.ss.android.article.base.ui.ad.a(this.getString(com.ss.android.article.browser.R.string.not_network_tip)),
                        com.ss.android.article.base.ui.ab.a(new com.ss.android.article.base.ui.aa(
                                this.getString(com.ss.android.article.browser.R.string.label_retry),
                                new View.OnClickListener() {
                                    @Override
                                    public final void onClick(View arg2) {
                                        if (NewArticleDetailFragment.this.mNewDetailViewHolder.mFooter instanceof Footer) {
                                            NewArticleDetailFragment.this.mNewDetailViewHolder.mFooter.onUserClick();
                                        }
                                    }
                                })));
            }

            this.mNoNetView.initNoDataActionBtn();
            this.mNoNetView.setVisibility(View.VISIBLE);
            this.mNewDetailViewHolder.mFooter.hide();
        }
    }

    private void maybeScrollToLastReadRecord() {
        int lastPosition;
        if ((this.mAppData.getAbSettings().isEnableArticleRecord())
                && !this.isFinishing()
                && System.currentTimeMillis() - this.aO <= 1000
                && !this.mNewDetailContext.s) {
            if (this.isNovel()) {
                String boolId = this.mNewDetailContext.articleDetail.novelData.getBookId();
                String itemKey = this.mArticle.getItemKey();
                lastPosition = !mRecordManager.serialRecordMap.containsKey(boolId)
                        || (android.support.design.a.isTextEmpty(itemKey))
                        || !itemKey.equals(mRecordManager.serialRecordMap.get(boolId).itemKey)
                        ? 0
                        : mRecordManager.serialRecordMap.get(boolId).record;
                if (lastPosition > 0) {
                    this.hasNovelLastReadPosition = true;
                }
                this.mRecordManager.serialRecordMap.remove(this.mNewDetailContext.articleDetail.novelData.getBookId());
            } else {
                String itemKey = this.mArticle.getItemKey();
                if (mRecordManager.articleReadPositionRecordMap.containsKey(itemKey)) {
                    lastPosition = mRecordManager.articleReadPositionRecordMap.get(itemKey).intValue();
                } else {
                    lastPosition = 0;
                }
            }
            this.scrollWebPageToPosition(lastPosition);
        }
    }

    private boolean isNovel() {
        return this.mNewDetailContext != null
                && this.mNewDetailContext.articleDetail != null
                && this.mNewDetailContext.articleDetail.novelData != null;
    }

    private void report(String event, BaseArticle arg11, long arg12, JSONObject arg14) {
        JSONObject v8;
        long v4 = 0;
        String enterFrom = this.getEnterFrom();
        if (!android.support.design.a.isTextEmpty(event)) {
            long groupItemId = arg11 != null ? arg11.itemId : v4;
            int aggrType = arg11 != null ? arg11.aggrType : 0;
            if (arg14 == null) {
                v8 = new JSONObject();
            } else {
                v8 = arg14;
            }

            try {
                if (!v8.has("item_id")) {
                    v8.put("item_id", groupItemId);
                }

                if (!v8.has("aggr_type")) {
                    v8.put("aggr_type", aggrType);
                }
            } catch (Exception exception) {
            }
            Context context = this.getContext();
            if (arg11 != null) {
                v4 = arg11.groupId;
            }

            MobClickCombiner.onEvent(context, event, enterFrom, v4, arg12, v8);
        }
    }

    private void reportArticleSubOrUnsub(String event, JSONObject arg13, BaseArticle arg14) {
        String v10;
        String v0_2;
        long v4 = 0;
        JSONObjectWrapper v8 = new JSONObjectWrapper();
        String v1 = this.getEnterFrom();
        long v6 = arg14 != null ? arg14.itemId : v4;
        int v0 = arg14 != null ? arg14.aggrType : 0;
        String v9 = "group_id";
        long v2 = arg14 != null ? arg14.groupId : v4;
        JSONObjectWrapper jsonObjectWrapper = v8.put(v9, Long.valueOf(v2)).put("item_id", Long.valueOf(v6)).put("aggr_type", Integer.valueOf(v0));
        String v3 = "log_pb";
        jsonObjectWrapper.put(v3, this.mNewDetailContext != null ? this.mNewDetailContext.logPb : "");
        v0_2 = this.mCategoryName;
        if (v1 == null) {
            v10 = v1;
            v1 = v0_2;
            v0_2 = v10;
        } else if (v1.equals("click_" + this.mCategoryName)) {
            v0_2 = "click_category";
            v1 = this.mCategoryName;
        } else if (v1.equals("click_headline")) {
            v10 = v1;
            v1 = this.mCategoryName;
            v0_2 = v10;
        } else {
            v10 = v1;
            v1 = v1.replaceFirst("click_", "");
            v0_2 = v10;
        }

        v8.put("enter_from", v0_2).put("category_name", v1);
        if (AppData.getInstance().getAbSettings().isApplogStaging()) {
            v8.put("_staging_flag", Integer.valueOf(1));
        }

        if (this.mNewDetailContext.searchResultId != v4) {
            v8.put("search_result_id", Long.valueOf(this.mNewDetailContext.searchResultId))
                    .put("source", this.mNewDetailContext.source)
                    .put("query", this.mNewDetailContext.query);
        }

        v8.put(arg13);
        android.support.design.a.onEvent(event, v8.jo);
    }

    private void reportEvent(String event, BaseArticle arg9, long arg10) {
        this.report(event, arg9, arg10, null);
    }

    final void showCommentListOrSofa(NewDetailViewHolder newDetailViewHolder, CommentTabCache commentTabCache) {
        if (newDetailViewHolder != null && commentTabCache != null) {
            if (commentTabCache.mArticleTabComments[0].isEmpty()) {
                newDetailViewHolder.mFooter.hideFooterContent();
                boolean visible = commentTabCache.mArticleTabComments[0].banComment;
                if (!visible && this.mArticle != null) {
                    visible = this.mArticle.mBanComment;
                }
                visible = !visible;
                newDetailViewHolder.mNewDetailPageExtra.setSofaLayoutVisibility(visible);
            } else {
                newDetailViewHolder.mFooter.setViewMoreText(com.ss.android.article.browser.R.string.ss_load_more);
                if (commentTabCache.mArticleTabComments[0].hasMore) {
                    newDetailViewHolder.mFooter.switchToMoreContent();
                } else {
                    newDetailViewHolder.mFooter.hideFooterContent();
                }

                newDetailViewHolder.mNewDetailPageExtra.setSofaLayoutVisibility(false);
            }
            if (commentTabCache.load[0]) {
                newDetailViewHolder.mFooter.switchToLoading();
            }

            newDetailViewHolder.mNewDetailAdapter.addAllComment(commentTabCache.mArticleTabComments[0].commentWrapperList);
            newDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
        }
    }

    private void loadMultiTabComment(long topCommentId) {
        if (this.mNewDetailViewHolder != null
                && this.mNewDetailViewHolder.mCommentTabCache != null
                && this.mAppData.commentLoadMultiTab()) {
            ArticleTabComment articleTabComment = this.mNewDetailViewHolder.mCommentTabCache.mArticleTabComments[1];
            if (!articleTabComment.hasComment) {
                CommentFetcher commentFetcher = new CommentFetcher(articleTabComment.increateCounter(), this.mArticle, 1, 0, topCommentId);
                this.mPresenter.loadComment(commentFetcher.getItemKey(), commentFetcher);
                this.mNewDetailViewHolder.mCommentTabCache.load[1] = true;
            }
        }
    }

    private void a(NewDetailViewHolder newDetailViewHolder, Article article, long arg18, boolean arg20) {
        if (newDetailViewHolder != null) {
            if (!article.delete) {
                boolean v3 = false;
                int v2 = 0;
                long v4 = article.groupId;
                long v6 = article.itemId;
                int v8 = article.aggrType;
                String articleUrl = null;
                if (article.hasArticleUrl()) {
                    articleUrl = article.articleUrl;
                    v3 = article.d();
                    if ((article.c()) && arg18 <= 0) {
                        v2 = 1;
                    } else {
                        v2 = 0;
                    }
                }
                if (!android.support.design.a.isTextEmpty(articleUrl)) {
                    if (v2 != 0 && !this.aH) {
                        this.aH = true;
                        this.onEvent("transcode_false");
                    }

                    if (!arg20 && arg18 <= 0) {
                        newDetailViewHolder.mDetailScrollView.setVisibility(View.VISIBLE);
                        this.V();
                        mPresenter.mDetailWebInteractor.mDetailLoadResultHandler.mDetailWebInteractorHolder = new DetailLoadResultHandler.DetailWebInteractorHolder(this.mPresenter.mDetailWebInteractor);
                        mPresenter.mDetailWebInteractor.mDetailLoadResultHandler.mDetailLoader.commonRequest(articleUrl, v4);
                        this.showLoadingProgress(10);
                        this.mPresenter.mDetailWebInteractor.j = 2;
                    } else {
                        if (articleUrl.equals(newDetailViewHolder.mWebView.getUrl())) {
                            LoadUrlUtils.loadUrl(newDetailViewHolder.mWebView, "about:blank");
                        }

                        Response response = this.mPresenter.mDetailWebInteractor.mResponse;
                        if (response != null
                                && response.responseCode == 200
                                && !android.support.design.a.isTextEmpty(response.requestUrl)
                                && (AppUtil.a(response.originUrl, articleUrl))) {
                            articleUrl = response.originUrl;
                        }

                        if (arg18 <= 0) {
                            if (this.mPresenter.mDetailWebInteractor.mMyWebViewClient != null) {
                                this.mPresenter.mDetailWebInteractor.mMyWebViewClient.a(articleUrl);
                            }
                        }

                        String v2_3 = this.a(newDetailViewHolder, articleUrl, v3);
                        if (arg20) {
                            newDetailViewHolder.mWebView.setTag(com.ss.android.article.browser.R.id.webview_clear_history_key, v2_3);
                        }
                    }
                } else {
                    this.U = true;
                    this.showContent(this.mNewDetailContext.articleDetail);
                }

                if (newDetailViewHolder.m) {
                    long v2_4 = System.currentTimeMillis();
                    if (article != null && v2_4 - article.clickTimestamp < 60000) {
                        this.d(article);
                    }

                    if (this.J > 0) {
                    } else {
                        this.J = v2_4;
                        this.c = new BaseArticle(v4, v6, v8);
                        this.K = arg18;
                    }
                }

                newDetailViewHolder.mNewDetailPageExtra.setArticle(article);
                if (article != null) {
                    ArticleInfo v2_5 = this.mPresenter.mDetailLoadResultHandler.getArticleInfo(article.groupId);
                    v4 = System.currentTimeMillis();
                    v2 = v2_5 == null || v4 - v2_5.d > 600000 ? 1 : 0;
                    if (v2 == 0) {
                    } else {
                        if (!NetworkUtils.isNetworkAvailable(this.mContext)) {
                        } else {
                            final Presenter v2_6 = this.mPresenter;
                            String itemKey = article.getItemKey();
                            String v3_2 = this.mNewDetailContext.fromNotification ? "apn" : this.mNewDetailContext.detailSource;
                            ((ArticleDetailCommentPresenter) v2_6).mDetailLoadResultHandler.loadArticleInfo(itemKey, article, v3_2,
                                    new DetailLoadResultHandler.ResultListener<Article, ArticleInfo>() {
                                        private final ArticleDetailCommentPresenter a = (ArticleDetailCommentPresenter) v2_6;

                                        public final void onResult(Article article1, ArticleInfo articleInfo) {
                                            if (this.a.hasView()) {
                                                ((NewDetailView) this.a.mView).onArticleInfoLoaded(article1, articleInfo);
                                            }
                                        }
                                    });
                        }
                    }
                }
                if (article == null) {
                    return;
                }

                if (this.p()) {
                    return;
                }

                CommentTabCache commentTabCache = this.createCommentTabCache(article.groupId, newDetailViewHolder);
                v2 = System.currentTimeMillis() - commentTabCache.mArticleTabComments[0].h > 600000 ? 1 : 0;
                if (v2 == 0) {
                    return;
                }

                long v8_1 = 0;
                if (article.groupId > 0 && article.groupId == this.mItemId && !this.ad) {
                    v8_1 = this.mCommentId;
                    this.ad = true;
                }

                CommentFetcher commentFetcher = new CommentFetcher(commentTabCache.mArticleTabComments[0].increateCounter(), article, 0, 0, v8_1);
                this.mPresenter.loadComment(commentFetcher.getItemKey(), commentFetcher);
                commentTabCache.load[0] = true;
                this.loadMultiTabComment(v8_1);
                if (newDetailViewHolder == null) {
                    return;
                }

                if (!NetworkUtils.isNetworkAvailable(this.mContext)) {
                    return;
                }

                if (newDetailViewHolder.mNewDetailAdapter.getCount() != 0) {
                    return;
                }

                newDetailViewHolder.mFooter.switchToLoading();
            } else if (!this.isFinishing()) {
                ((NewDetailActivity) this.getActivity()).switchToArticleDeleted(article);
            }
        }
    }

    public final String a(NewDetailViewHolder newDetailViewHolder, String url, boolean webviewSupportJS) {
        if (newDetailViewHolder == null) {
            return "";
        }

        UIUtils.setVisibility(newDetailViewHolder.mDetailScrollView, View.VISIBLE);
        UIUtils.setVisibility(newDetailViewHolder.mWebView, View.VISIBLE);
        if (this.mNewDetailContext.articleDetail != null) {
            this.a(this.mNewDetailContext.articleDetail.name,
                    this.mNewDetailContext.articleDetail.avatarUrl,
                    this.mNewDetailContext.articleDetail.mediaId,
                    false);
        }

        this.V();
        newDetailViewHolder.mWebView.setTag(com.ss.android.article.browser.R.id.webview_history_key, null);
        newDetailViewHolder.m = true;
        ScrollListenerWebView scrollListenerWebView;
        int v2;
        int v9 = 3;
        int v10 = 2;

        if (webviewSupportJS) {
            String font = "m";
            if (this.mFontSizePref == 1) {
                font = "s";
            } else if (this.mFontSizePref == v10) {
                font = "l";
            } else if (this.mFontSizePref == v9) {
                font = "xl";
            }

            v2 = this.mAppData.mLoadImagePref;
            NetworkType networkType = NetworkUtils.getNetworkType(this.mContext);
            int v1 = !this.mAppData.getAbSettings().isLoadImage4G() || networkType != NetworkType.MOBILE_4G ? 0 : 1;
            if (networkType != NetworkType.NONE) {
                if (networkType != NetworkType.WIFI && v2 == v10 && v1 == 0) {
                    v1 = 0;
                } else {
                    v1 = 1;
                }
            } else {
                v1 = 0;
            }

            int v6 = 0;
            if (!AppData.isNightMode()) {
                v6 = 1;
            }

            StringBuilder stringBuilder = new StringBuilder(url);
            if (url == null || url.indexOf(35) <= 0) {
                stringBuilder.append("#");
            } else {
                stringBuilder.append("&");
            }

            stringBuilder.append("tt_font=").append(font);
            stringBuilder.append("&tt_daymode=").append(v6);
            stringBuilder.append("&tt_image=").append(v1);
            stringBuilder.append("&tt_from=app");
            String h5Settings = this.mAppData.getAppSettings().getH5Settings();
            if (!android.support.design.a.isTextEmpty(h5Settings)) {
                try {
                    if (new JSONObject(h5Settings).getInt("pic_top_grid") == 1) {
                        stringBuilder.append("&pic_top_grid=1");
                    }
                } catch (JSONException jsonException) {
                }
            }
            url = stringBuilder.toString();
        } else {
            scrollListenerWebView = newDetailViewHolder.mWebView;
            v2 = this.mFontSizePref;
            if (scrollListenerWebView != null) {
                int v0_2 = v2 == 1 ? 1 : v10;
                if (v2 == v10) {
                    v0_2 = v9;
                }
                if (v2 == v9) {
                    v0_2 = 4;
                }
                com.bytedance.common.b.d.a(scrollListenerWebView, v0_2);
            }
        }

        scrollListenerWebView = newDetailViewHolder.mWebView;
        scrollListenerWebView.setTag(R.id.webview_support_js, webviewSupportJS ? Boolean.TRUE : null);
        newDetailViewHolder.mWebView.setTag(R.id.webview_client_transform_key, null);
        newDetailViewHolder.mWebView.setTag(R.id.webview_transform_key, null);
        HashMap additionalHttpHeaders = new HashMap();
        if (this.mArticle != null) {
            String userAgent = this.mCustomUserAgent;
            if ((this.mArticle.hasArticleUrl()) && (this.mArticle.e())) {
                userAgent = this.mOriginUserAgent;
            }
            AppUtil.appendAdditionHttpHeaders(additionalHttpHeaders, userAgent, this.mArticle.wapHeaders);
        }

        TTUtils.webViewLoadUrl(url, newDetailViewHolder.mWebView, additionalHttpHeaders);
        this.e(url);
        if (this.mArticle != null) {
            this.d(this.mArticle);
        }
        this.h(newDetailViewHolder);
        newDetailViewHolder.mDetailScrollView.setEnableDetectContentSizeChange(true);
        return url;
    }

    @Override
    public final void showContent(ArticleDetail articleDetail) {
        if (articleDetail != null) {
            if (!articleDetail.delete) {
                if (this.U) {
                    ((NewDetailActivity) this.getActivity()).inflatDetailErrorView().showLoadingView();
                    this.hideProgressBar();
                    this.mRootView.setVisibility(View.INVISIBLE);
                }

                String content = articleDetail.content;
                String authorInfoJSON = articleDetail.h5Extra;
                this.mNewDetailContext.articleDetail = articleDetail;
                this.a(articleDetail.name, articleDetail.avatarUrl, articleDetail.mediaId, true);
                if (this.mNewDetailContext.adId > 0 && !android.support.design.a.isTextEmpty(this.mArticleUrl)) {
                    this.mArticle.articleUrl = this.mArticleUrl;
                }

                if (this.mNewDetailViewHolder != null) {
                    this.setUserAgent(this.mArticle, this.mNewDetailViewHolder.mWebView);
                }

                this.maybeReplaceUserAgent(this.mArticle);
                boolean isContentEmpty = android.support.design.a.isTextEmpty(content);
                boolean isNetworkAvailable = NetworkUtils.isNetworkAvailable(this.mContext);
                this.bindContent(this.mNewDetailViewHolder, content, authorInfoJSON);
                long now = System.currentTimeMillis();
                long expireSeconds = this.mAppData.mArticleExpireSeconds;
                if (articleDetail.expireSeconds > 0) {
                    expireSeconds = articleDetail.expireSeconds;
                }

                if (expireSeconds <= 0 || expireSeconds > 3600) {
                    expireSeconds = 600;
                }

                long pastTime = now - articleDetail.timestamp;
                if (Logger.debug()) {
                    Logger.v(NewArticleDetailFragment.TAG, "check refresh: " + now + " - " + articleDetail.timestamp + " = " + pastTime + "  " + 1000 * expireSeconds);
                }

                if (pastTime > expireSeconds * 1000L && isNetworkAvailable) {
                    String cacheToken = articleDetail.cacheToken;
                    if (Logger.debug()) {
                        Logger.d(NewArticleDetailFragment.TAG, "try refresh detail: " + this.mArticle.groupId + " " + cacheToken);
                    }

                    String itemKey = this.mArticle.getItemKey();
                    mPresenter.mDetailLoadResultHandler.mArticleDetailWithCacheResultListener = new DetailLoadResultHandler.ResultListener<Article, ArticleDetail>() {

                        public final void onResult(Article article, ArticleDetail articleDetail1) {
                            if (mPresenter.hasView()) {
                                ((NewDetailView) mPresenter.mView).onArticleDetailLoadedWithCache(article, articleDetail1);

                            }
                        }
                    };
                    mPresenter.mDetailLoadResultHandler.mDetailLoader.mArticleDetailAsyncCacheLoader.addTask(itemKey, mArticle, cacheToken, null);
                    this.isArticleDetailLoading = true;
                }
                this.setDisableScrollOver(this.mArticle);
                this.handleExtraPage();
                if (this.mNewDetailViewHolder.m) {
                    this.J = System.currentTimeMillis();
                    this.c = new BaseArticle(this.mArticle.groupId, this.mArticle.itemId, this.mArticle.aggrType);
                    this.K = this.mNewDetailContext.adId;
                }

                if ((this.mNewDetailContext.viewSingleId) && !isContentEmpty) {
                    Article v9 = this.mArticle;
                    long v10 = this.mNewDetailContext.adId;
                    this.J = 0;
                    this.c = null;
                    if (v9 != null) {
                        if (mNewDetailViewHolder != null && (mNewDetailViewHolder.l)) {
                            this.d(v9);
                        }

                        if (mNewDetailViewHolder == null) {
                        } else {
                            if (!mNewDetailViewHolder.m) {
                            } else {
                                this.J = System.currentTimeMillis();
                                this.c = new BaseArticle(v9.groupId, v9.itemId, v9.aggrType);
                                this.K = v10;
                            }
                        }
                    }

                    if (!this.mNewDetailContext.viewSingleId && v9 != null && mNewDetailViewHolder != null && !mNewDetailViewHolder.m) {
                        this.a(mNewDetailViewHolder, v9, v10, false);
                    }

                    int showLoadingProgress = 1;
                    if (mNewDetailViewHolder != null && (mNewDetailViewHolder.hasArticleUrl(v9))) {
                        int progress = mNewDetailViewHolder.mWebView.getProgress();
                        if (progress > 0 && progress < 100) {
                            this.showLoadingProgress(progress);
                            showLoadingProgress = 0;
                        }
                    }
                    if (showLoadingProgress != 0) {
                        this.hideProgressBar();
                    }

                    CommentTabCache commentTabCache = this.createCommentTabCache(this.itemId, this.mNewDetailViewHolder);
                    if (mNewDetailViewHolder == null) {
                        this.Q();
                        return;
                    }

                    if (mNewDetailViewHolder == null) {
                        this.Q();
                        return;
                    }

                    if (commentTabCache == null) {
                        this.Q();
                        return;
                    }

                    mNewDetailViewHolder.mNewDetailPageExtra.setArticle(v9);
                    ArticleTabComment articleTabComment = commentTabCache.mArticleTabComments[0];
                    if (articleTabComment.hasComment) {
                        if (commentTabCache.load[0]) {
                            mNewDetailViewHolder.mFooter.switchToLoading();
                        } else if (articleTabComment.isEmpty()) {
                            mNewDetailViewHolder.mFooter.hideFooterContent();
                            boolean v0_5 = articleTabComment.banComment;
                            if (!v0_5 && v9 != null) {
                                v0_5 = v9.mBanComment;
                            }

                            NewDetailPageExtra newDetailPageExtra = mNewDetailViewHolder.mNewDetailPageExtra;
                            v0_5 = !v0_5 ? true : false;
                            newDetailPageExtra.setSofaLayoutVisibility(v0_5);
                        } else {
                            if (articleTabComment.hasMore) {
                                mNewDetailViewHolder.mFooter.switchToMoreContent();
                            } else {
                                mNewDetailViewHolder.mFooter.hideFooterContent();
                            }
                        }
                        mNewDetailViewHolder.mNewDetailAdapter.addAllComment(articleTabComment.commentWrapperList);
                        mNewDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                        this.Q();
                        return;
                    }

                    if (v9 == null) {
                        mNewDetailViewHolder.mFooter.hideFooterContent();
                    } else if (!NetworkUtils.isNetworkAvailable(this.mContext)) {
                        this.checkNetworkAndShowNoNetView();
                    } else if (commentTabCache.load[0]) {
                        mNewDetailViewHolder.mFooter.switchToLoading();
                    } else {
                        CommentFetcher v1_3 = new CommentFetcher(articleTabComment.increateCounter(), v9, 0, 0, 0);
                        this.mPresenter.loadComment(v1_3.getItemKey(), v1_3);
                        commentTabCache.load[0] = true;
                        mNewDetailViewHolder.mFooter.switchToLoading();
                        this.webviewContentResize(0);
                    }
                    mNewDetailViewHolder.mNewDetailAdapter.addAllComment((List) null);
                    mNewDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                }
                this.Q();
            } else if (!this.isFinishing()) {
                ((NewDetailActivity) this.getActivity()).switchToArticleDeleted(this.mArticle);
            }
        }
    }

    final CommentTabCache createCommentTabCache(long itemId, NewDetailViewHolder newDetailViewHolder) {
        CommentTabCache commentTabCache = this.mInfoLRUCache.get(Long.valueOf(itemId));
        if (commentTabCache == null) {
            commentTabCache = newDetailViewHolder.mCommentTabCache;
            if (commentTabCache == null || itemId != commentTabCache.itemId) {
                commentTabCache = new CommentTabCache(itemId);
            }
            this.mInfoLRUCache.put(Long.valueOf(itemId), commentTabCache);
        }

        if (newDetailViewHolder.mCommentTabCache != commentTabCache) {
            newDetailViewHolder.mCommentTabCache = commentTabCache;
        }

        return commentTabCache;
    }

    /**
     * @param newDetailViewHolder
     * @param content             <header><div class="tt-title">上海33岁女博士闫宏微：赴美抗癌不幸病逝，今丈夫带幼女独自生活</div><div class="authorbar" style="padding-bottom:3px;"><div class="avatar"><a class="author-avatar-link"><div class="author-avatar"><img class="author-avatar-img" src="http://p1-dy.bytexservice.com/large/pgc-image/8844dbca13044a75ba5718f3946e562b"></div></a></div><div class="author-function-buttons"><button class="follow-button"></button></div><div class="author-bar"><div class="name-link-wrap"><div class="name-link-w"><a class="author-name-link pgc-link">孤风婉史</a></div></div><a class="sub-title-w"><span class="sub-title">1642130840</span></a></div></div></header>
     *
     *
     *                            <article><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Ffd31bc032de1477290fc7355c9925de2%3Ffrom%3Darticle.detail%26_iz%3D31825&index=0" width="640" height="394" thumb_width="120" thumb_height="74" zip_src_path="eJzk0bFOwzAQxvF3uTmJnUvdYEsVDwIIubaTHth165wZqPLuSAzMqEMY2E_66b7_DXKhmc5gblBLXMA8wYn5shghLrjvOFcmmynNnctJRFvmIDgvrTu31F4_3jBed_pdiskP_dHJAX3od-OIWk5uHJRyWqPyAR-nktPBFiYXQ-cDW4rPVUrcv9LnYegfUEHzL-mXBmohMHA_A2sDfKrp-MuM37dbbPl38tZP_1S8n4F1_QoAAP__HBEieA=="  ></a><p class="pgc-img-caption">闫宏微一家合影</p></div><p data-track="277"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">2020年3月，一位名叫吴载斌的男人在社交平台上发布了一篇文章：</span></p><blockquote class="pgc-blockquote-abstract"><p>“亲爱的，我恋爱了，她是善良勇敢的白衣天使，刚从武汉胜利归来的人民英雄……往后的日子，我把思念留给你，把爱给她。”</p></blockquote><p data-track="174"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一篇原本感人肺腑的告白文章，却在网络上引起轩然大波。</span></p><p data-track="176"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">文章中的“亲爱的”，是吴载斌已经离世的前妻，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一个同癌症抗争许久的勇敢女孩。</span></strong></p><p data-track="177"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">此时距离闫宏微离世，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">不过一年多的时间。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">吴载斌短时间内再婚的消息，引起了巨大的争议。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F6ff49a3913cd4f4681c3cacbfbf717e9%3Ffrom%3Darticle.detail%26_iz%3D31825&index=1" width="640" height="495" thumb_width="120" thumb_height="93" zip_src_path="eJzM0bFOwzAUheF3uXMSJ7Zxa0sVDwIIOa6dXrDr1rlmoMq7IzGwwJQhdD_Sp6P_BrnghGcwN6glzmCe4ER0mQ1jF646ypXQZkxT53Ji0ZbJM8pz684tttePNx6vUr_3TIUgtRV6EO4og1T7wQln3RjGsBt2Xj-GktPBFkIXfXf0ZDE-177n6hU_D2LY8wdo7oIW28ovDdSCYGA9A0sDdKpp_LPirz_f0_-JuBm98emfiOsZWJavAAAA__9PNihj"  ></a><p class="pgc-img-caption"></p></div><h1 class="pgc-h-arrow-right" data-track="178">平静生活，天降横祸</h1><p data-track="179"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">2019年，医疗纪录片《<span class="candidate-entity-word" data-gid="39790" qid="6585043292755350797" mention-index="0">人间世2</span>》迎来了大结局。</span></p><p data-track="180"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">9个摄制组、50个人、200个拍摄对象，他们在冰冷的手术室内，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">上演着一场场同病魔赛跑的人生高歌。</span></strong></p><p data-track="181"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">《人间世》的众多故事中，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微也是其中的主角。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">摄制组拍摄215天，闫宏微的强大、无助、悲痛，都让人印象深刻。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp6.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F57d31c0fae3e42b693048999bd817a79%3Ffrom%3Darticle.detail%26_iz%3D31825&index=2" width="640" height="390" thumb_width="120" thumb_height="73" zip_src_path="eJzk0cFOhDAUheF3uWugpWWANpn4IGpMKR3majudKbcuJLy7iQtd4IpEXbg_yZecf4GYcMIL6AVy8jPoezgTXWfN2LWtKGZCEzFMlY2BeZMmxyjOpb2UWN5en4W_NeqFs0M3ytryk3HSNWJoleRNr5Qaxr7uTKfuTimGo0mE1rtqdGTQP2TORfuEb0dZ9-IAxZcs_4v8WEBOCBr2M7AWQOcchm8bik3Ej-1vXPmH9Kbiz8qfFfczsK7vAQAA__8HkCDZ"  ></a><p class="pgc-img-caption"></p></div><p data-track="182"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微原本是一个普普通通的农村姑娘，却凭借着自己的勤奋努力，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">以优异的成绩考上博士</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，成功落户上海。后来，闫宏微进入上海的一所大学担任教师，生活充实且幸福。</span></p><p data-track="183"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">不久后，热情开朗、乐观向上的闫宏微遇到了自己的丈夫，两个人相互携手，走进婚姻的殿堂。</span></p><p data-track="184"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">女儿出生后，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微一家人的生活其乐融融</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，赢得了众人的羡慕。没有人想到，这平静的外表下，隐藏着足以毁天灭地的危机。</span></p><p data-track="185"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一次体检，闫宏微被查出患有<span class="candidate-entity-word" data-gid="302221" qid="6538757047914124547" mention-index="0">乳腺癌</span>。在癌症之中，闫宏微患上的晚期三阴性乳腺癌，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">风险最大也最难治愈。</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp9.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Fa05ccb9f4bc14b8f911d203d27eddf79%3Ffrom%3Darticle.detail%26_iz%3D31825&index=3" width="640" height="403" thumb_width="120" thumb_height="76" zip_src_path="eJzk0btOwzAUxvF3OXMSX5JebKniQQAhX9MDdt06xwxUeXckBgbE1KEM7Ef66Xz_K5SKM55AX6HVtIB-hCPRedGMndVApRGagnkeXMksmToHRmXp3anH_vL-KtNlUm-cGb5xzqo4WScmu49KCC_56OUueB936iHWkg-mEroUBh_IYHpqnMvtC34cRrGXG-j-ofzcQasIGm5nYO2Aji3bXxvK7c-Hvm7vMeUf0uN95e-KtzOwrp8BAAD__1ImJ8g="  ></a><p class="pgc-img-caption"></p></div><p data-track="186"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一直以来，作为女性癌症中最凶险的一类，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;"><span class="candidate-entity-word" data-gid="8452766" qid="6546468146813883652" mention-index="1">三阴性乳腺癌</span>让人闻之色变。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一旦人们的身体被这一类癌细胞攻击，内脏、骨头，甚至是头部，都将成为他的猎物。</span></p><p data-track="187"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">著名歌手<span class="candidate-entity-word" data-gid="5864028" qid="6595888411993707789" mention-index="0">姚贝娜</span>就是三阴性患者</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，尽管与癌症抗争多时，却仍然被三阴性乳腺癌夺去了生命。</span></p><p data-track="188"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">作为普通人，刚刚得知闫宏微的身体状况，一家人都痛苦不堪。只有天生乐观的闫宏微安慰道：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“不愧是我的癌细胞，牛！”</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F4402b1002b5a4f5888ca431b300fda42%3Ffrom%3Darticle.detail%26_iz%3D31825&index=4" width="640" height="525" thumb_width="120" thumb_height="98" zip_src_path="eJzE0sFqwzAMxvF30TmJFccprqHsQbYxbDdJtdl168g7rOTdBztssO1UaHMX_Pj46wIp00RHMBcoOcxgHuHAfJqNECe5aTgVJpsoTo1PUQSbp0Fwmmt_rKk-v7_KcFbbNxRKoXQtonS9VWOvtfZWda3rEMe9VfJhzCnubGbyYWj2A1sKTwVRbl7oY9e1WvZQ_dDb1eQ7b36uoGQCA9czsFTAhxLdvxG733u-TldpeDf57-Pelv6OeD0Dy_IZAAD__yQCH00="  ></a><p class="pgc-img-caption"></p></div><p data-track="189"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">尽管如此，越来越差的身体状况还是时刻提醒着闫宏微：她已经成为一个病人。</span></p><p data-track="190"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">渐渐地，闫宏微开始呕吐、头发脱落，皮肤变黑，指甲溃烂。</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">她每天需要吞服大量的药物</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，定期前往医院做化疗。</span></p><p data-track="191"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一周一次的化疗，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">42天一次的复诊</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，在期待与失望中反复横跳，闫宏微的身心都承受着巨大的折磨。</span></p><p data-track="192"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">然而三阴性乳腺癌太过顽固，医生和患者的努力，起到的作用微乎其微。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F9759b20926694259b8fe685eecc125cc%3Ffrom%3Darticle.detail%26_iz%3D31825&index=5" width="640" height="443" thumb_width="120" thumb_height="83" zip_src_path="eJzk0bFOwzAQxvF3uTmJ3WttYksVDwIIOcZND-y6dc4MVHl3JAYYYMoQhu4n_XTf_wq50EgnsFeoJU5gH-DIfJ6sEOdtx7kyuUxp7HxOIroyBsF5av2ppfby_orxsjNvUpg7ZQaUBrU2O1Rm6A9B9yoE7zeovL8_lJz2rjD5GLqXwI7iY5US9TN97LebHhU0PzLqm6GfGqiFwMJyBuYG-FjT8GfF3w993f7PlqvRK8vfFZczMM-fAQAA__-yNSGL"  ></a><p class="pgc-img-caption"></p></div><blockquote class="pgc-blockquote-abstract"><p>闫宏微经常同癌细胞对话：“你要是聪明，就别长太快，不然我死了，你不也就完了？”</p></blockquote><p data-track="194"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">这个天生喜欢挑战不可能的姑娘，充满着叛逆精神，她多次提到：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“想要改造自己的癌细胞，让它变得聪明一点。”</span></strong></p><p data-track="195"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">第五次化疗后，闫宏微依然收到了最坏的消息，她体内的肿块非但没有减少，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">反而正以疯狂的速度扩散、蔓延。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">更致命的是，闫宏微体内的癌细胞，已经扩散到肺部。</span></p><blockquote class="pgc-blockquote-abstract"><p>“我打了这么多的化疗药，你说血管都快打没了，这个东西，一点都不作效，它们也是神了。”</p></blockquote><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Ffd18bf5625024a0d89875a9c5dbf8cb2%3Ffrom%3Darticle.detail%26_iz%3D31825&index=6" width="640" height="399" thumb_width="120" thumb_height="75" zip_src_path="eJzE089KAzEQx_F3mfPuJk2bNRsoPogWyZ_NdjRp2uzEg2XfXVDBgweh0PY-zOfw5XeGXHDCA-gz1IKgIZoyjYzy3LpDi-3p_VXE02Z44yz4lbJB9kJysTHcq0E9SDM46W1QzgpooJY4g36CPdFx1owd1x3lSmgypqlzObHL3z-GktPWFEIXx86PZDA-V85F_4If2_VKCQnNrzzcTe5vK--WBmhfk_1u-F-Ar9O7BLiZLP4UuC69a362czkDy_IZAAD__3V4JOg="  ></a><p class="pgc-img-caption"></p></div><p data-track="198"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">见到这一状况，医生都有些无可奈何。一向坚强的闫宏微崩溃了，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">她独自一个人蹲在医院的角落里</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，哭得泣不成声。</span></p><p data-track="199"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">不远处</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，闫宏微的丈夫也满含热泪看着这一切。这条</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">充满绝望的治疗之路，让所有人都悲痛欲绝。</span></p><p data-track="200"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">为了不影响闫宏微的情绪，他只能装作若无其事地走过去，安慰妻子一定会好起来的。</span></p><blockquote class="pgc-blockquote-abstract"><p>痛苦过后，闫宏微再次振作精神，她说道：“我今年才33岁，我不能被癌症打败，我想活着，好好地看着女儿长大。”</p></blockquote><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Fcc74526af78447e4a71a1c16bba8b31e%3Ffrom%3Darticle.detail%26_iz%3D31825&index=7" width="640" height="535" thumb_width="120" thumb_height="100" zip_src_path="eJzk0rFOwzAQxvF3uTmJY8dNgqWKBwGEzsZND-y6dc4MVHl3JAYYwlSJLOwn_aT7f1dImSY6gblCyWEG8wBH5vNshDirvuFUmDBRnBqXogiYJy84zbU71VRf3l9VuOi7t1Y4N-id6vEwjFoPXuMgUTrZW4uj7aS_P-QU95iZXPDNi2ek8FjaVvXP9LHv5Kh2UP3Q3X-RnyoomcDA7QwsFfCxRPtrxFXDr9MtPrmez2b0KuLfyt8Rb2dgWT4DAAD__504JIk="  ></a><p class="pgc-img-caption"></p></div><h1 class="pgc-h-arrow-right" data-track="280">远赴美国，失望而归</h1><p data-track="203"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">为了求得一线生机，闫宏微和丈夫商量，前往美国安德森癌症中心检查。</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">他们变卖了家中所有值钱的物品</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，却只凑了24000美元。</span></p><p data-track="204"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">在此之前，闫宏微每个月能够获得上万元的收入，然而化疗费用巨大，长久以来，闫宏微已经家徒四壁，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">24000美元于他们而言已经是极限。</span></strong></p><p data-track="205"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">安德森癌症中心代表世界癌症治疗的最高期望，有了这一期盼，闫宏微恢复了从前的活力满满。她同丈夫认真地准备着签证面试，模拟着签证官的问题。</span></p><p data-track="206"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">最终，皇天不负有心人，闫宏微顺利拿到了签证，同丈夫坐上了前往美国的飞机。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F9d62a27623d2423583450c1cc817c7ff%3Ffrom%3Darticle.detail%26_iz%3D31825&index=8" width="640" height="490" thumb_width="120" thumb_height="92" zip_src_path="eJzE0s1OwzAMwPF38bltUqdNu0gTDwIIhfRjhmTZUocDU98diQMcxmkS693ST_bfF4iJZjqCuUBOfgHzCAfm02KEOKGuOGYmGynMlYtBeJvmUXBcSncsqTx_vKE_N7t3KXaDRoudRjVgg6rtVdNKVzvX153rpulhSjHsbWJyfqyGkS35pywl6hf63Ku6xxaKX3o7Wd1Xfi4gJwIDtzOwFsCHHF7_jHi1z_foJpe8m3z1Pf8r_zS8nYF1_QoAAP__Q4Uenw=="  ></a><p class="pgc-img-caption"></p></div><p data-track="207"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">安德森医院，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一年接待成千上万名癌症病人</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，如同闫宏微一般慕名前来的中国人不在少数，医生、护士早已习以为常。</span></p><p data-track="208"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">按照医院的惯例，闫宏微做了初步的检查。第7天，闫宏微见到了主治医生。医生看完报告后说道：</span></p><blockquote class="pgc-blockquote-abstract"><p>“您的症状看上去并不像是典型的三阴性乳腺癌，具体的需要做进一步的肺部穿刺手术才行。”</p></blockquote><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp9.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Fe79641af336341289d775cc729cfca48%3Ffrom%3Darticle.detail%26_iz%3D31825&index=9" width="640" height="392" thumb_width="120" thumb_height="74" zip_src_path="eJzE0bFuwyAQxvF3udk2NhAwSFEfpK0qSrBzLYQEHx0a-d0rdWjXKIOzn_TTff8r0LGmd7BXqCUuYJ_hSHReLGNn01GuhC5jmjufE_s9ZZSX1p9abC9fHzxepPnsWdBGycFNQighBz6ag9Y77zU3fvJOjk9TyWnvCqGPoTsEchhfat9z9YbfezGMfAfNv8zVw-iN5dcGakGwcD8DawO54Iyn2ypGV-awxZTiYfLGP_9FvJ-Bdf0JAAD__1WvIM4="  ></a><p class="pgc-img-caption"></p></div><p data-track="210"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">医生仅问诊了30分钟的时间，闫宏微就花费了600多美元。闫宏微疑惑不已，美国医生的解释，与国内医院的结论完全不同。</span></p><p data-track="211"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">正当她计划去做<span class="candidate-entity-word" data-gid="3937605" qid="6548304693590758664" mention-index="1">穿刺</span>时，却被告知：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“您的账户余额不足以安排手术。”</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">原来，美国的医院，一次穿刺手术就需要十万元人民币。</span></p><p data-track="212"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">万般无奈之下，闫宏微和丈夫只能打电话给国内的家人，借了一些钱。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F2b8dcdf36d424462a69648a2c5fe2bf2%3Ffrom%3Darticle.detail%26_iz%3D31825&index=10" width="640" height="361" thumb_width="120" thumb_height="68" zip_src_path="eJzc0b9OwzAQx_F3uTmJw9W1EksVDwIIOf6THth165wZqPLuSAwwwNSBSOwnfXS_7xVyoZlOoK9QS1xAP8CR-bxoIc6oOs6VyWRKc2dzEtGU2QvOS2tPLbWXtxeMFzm-9gKnwVkXdspJlFKhUaOSg0G7Dx6ngPeh5HQwhclG3znPhuJj7XtUz_R-2N0NuIfmmx43k__66acGaiHQcDsDawN8rGn6teKPKT9Pt5ny39JfFW9nYF0_AgAA__9GMyVU"  ></a><p class="pgc-img-caption"></p></div><p data-track="213"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">对于闫宏微一家来说，这样的手术费是天价。与此同时，在等待结果的过程中，闫宏微和丈夫也面临着巨大的生活开销。</span></p><p data-track="214"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">来到美国后的一个月，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微花光了所有的积蓄。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">此时的他们，却无路可退。</span></p><blockquote class="pgc-blockquote-abstract"><p>最终，他们等到了结果：“我们通过您的穿刺手术结果来看，您的<span class="candidate-entity-word" data-gid="15596349" qid="6595785359337002248" mention-index="0">雌激素受体</span>呈阳性，也就是说不是典型三阴性乳腺癌，完全可以通过<span class="candidate-entity-word" data-gid="729925" qid="6527564522020934919" mention-index="0">内分泌治疗</span>来恢复健康。”</p></blockquote><p data-track="216"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">听到美国医生的话，闫宏微顿时信心倍增。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F4bcf7ba9a05f47f6a878c65e5497ee32%3Ffrom%3Darticle.detail%26_iz%3D31825&index=11" width="640" height="419" thumb_width="120" thumb_height="79" zip_src_path="eJzEksFOhDAQht9lzkCxQAtNNj6IbkypLTvabnfL1IMb3t2oBw-c5MAe5_J9mXz_DWLCCc-gbpCTn0E9wYnoMivGLlxUFDOhjhimysTAvE6TZRTn0pxLLK8fb9xf2-G9Zu1onBz1oOvOtdIJ3cveiM527SCtbfijSzEcdCI03lavljT651zXXLzg56F56HkHxZ-6uZt555-PBeSEoGC7BpYC6JTD-BvxG_ZzboMV6x2sYmzH_zPGeoG7qXd--rgsXwEAAP__MCMlgQ=="  ></a><p class="pgc-img-caption"></p></div><p data-track="217"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">在此之前，国内医生诊断，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微的病不能用普通的内分泌治疗。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">而今新的诊疗结果，让她看到了一线生机。</span></p><p data-track="218"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微和丈夫欣喜若狂，他们坐上了回国的飞机，第一时间来到了上海的医院。然而重燃希望的他们，却再次被泼了一盆冷水。</span></p><p data-track="219"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">见到美国安德森医院的报告，中国顶级癌症专家杨主任与胡主任不禁皱起眉头。大相径庭的结果，其中出现了什么差错？</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Ff2702d579a714b5f99b01f5a706068d4%3Ffrom%3Darticle.detail%26_iz%3D31825&index=12" width="640" height="383" thumb_width="120" thumb_height="72" zip_src_path="eJzc0c1OxCAUxfF3ueu2UKbAQDLxQdQY-kHnKgwz9OLCpu9u4sKNrrpQ4_4kv5z8V0gZZ7yAXaHksIC9hzPRdbGMXQ8NpULoEsa5GVJkweV5YpSWerjUWN9en0W4deaFMy80F6PUxum266U3puetl05zxdVx7O58TvHkMuEQpmacyGF4KJwL9YRvp0N7FBKqvyCrn5UfKygZwcJ-BrYK6Fxi_21D8eXQx_ZXIv5X-TPifga27T0AAP__-SEezA=="  ></a><p class="pgc-img-caption"></p></div><p data-track="220"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">为了确保万无一失，医生再次为闫宏微做了专门的治疗，最终得出了同从前一样的结论：雌激素仍然是阴性。</span></p><p><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">既然如此，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">为什么美国报告上却显示阳性？</span></strong></p><p data-track="221"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">上海医院的专家们联合会诊，最终给了闫宏微确定的答案：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">美国医院的阳性报告，或者是出自于肿瘤的异质性。</span></strong></p><p data-track="222"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">因肿瘤的异质性，会出现众多病灶，阴阳性并不确定。美国医院穿刺的部位，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">或许正是阳性的病灶。</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F0bc8bccd67e144e294c31973e63dd7a8%3Ffrom%3Darticle.detail%26_iz%3D31825&index=13" width="640" height="437" thumb_width="120" thumb_height="82" zip_src_path="eJzE08FOwzAMBuB38blt2qSkTaSJB4EJpUnoDMmypQ4Hpr47EiAhsdsO3d3yJ_-_fIGUccYj6AuUjKAhmDx7Rmmp7bHG-vzxxsO5V-8tayc7TtY6Ofiu7z1XvRWdGoSXwrnBjFBByWEB_QQHotOiGTtx2VAqhCZhnBubIrt9_-NrTnFnMqENvnGeDIbn0rZcvuDnTnQjf4DqjxZ3k9W28n6tgA4lTj8l_mvgKobv0bvEsJm88c376vd3bmdgXb8CAAD__0HiJNU="  ></a><p class="pgc-img-caption"></p></div><p data-track="223"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">与此同时，这次的检查结果显示，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微肺部的病灶再次扩大。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">为此，专家们不得不为闫宏微制定了新的方案。</span></p><p data-track="224"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">此番长途跋涉，花光了所有的积蓄，却得到了一个毫无意义的结果，闫宏微十分崩溃。</span></p><p data-track="225"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">然而闫宏微的病情却没有留给她足够的缓冲时间，不久后，她便再次踏上寻找新的治疗方法的路程。</span></p><p data-track="226"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">长时间身处医院，闫宏微只能拜托自己的母亲照顾孩子，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">与她见面的机会更是少之又少。</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp6.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Fe3b313575ab44eb4bfc214ab06bebf7f%3Ffrom%3Darticle.detail%26_iz%3D31825&index=14" width="640" height="448" thumb_width="120" thumb_height="84" zip_src_path="eJzE0bFOwzAQgOF3uTmJE9tJqaWKBwGEfMZOD-y6dc4MVHl3JAYYWFAl2v2XvuE_Qy400wHMGWqJC5gH2DMfFyPEceo4VyabKc2dy0lEW2YvOC-tO7TUnt5fZTzp7VsvvEI1qHEzWtTao8bg5KAt9hN6DJtwH0pOO1uYXPTdi2dL8bH2vZye6WOnhjs5QvMjy9vR2-vKTw3UQmDgcgbWBnhfE_5t4ld6m4lXo39N_F_5e-LlDKzrZwAAAP__b2koyA=="  ></a><p class="pgc-img-caption"></p></div><p data-track="227"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">女儿念叨最多的一句话便是：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“我想妈妈和爸爸，他们去哪儿了？这是在哪儿？”</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">姥姥只能柔声安慰，找借口搪塞，悄悄地将眼泪擦干。</span></p><p data-track="228"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">失去了所有希望的闫宏微只能放手一搏</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，最终，她选择了美国医生的治疗方案：靶向药物治疗。</span></p><p data-track="229"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微得知，香港有一种名叫帕博西尼的药物，对治疗癌症有着极好的效果。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F926107334e8c45fa83ac4208791e2528%3Ffrom%3Darticle.detail%26_iz%3D31825&index=15" width="640" height="449" thumb_width="120" thumb_height="84" zip_src_path="eJzk0bFOwzAQxvF3uTmJnbOTOpYqHgQQMsZND-y6dc4MVHl3JAYYYOrAkv2kn-77X4GPNT2DvUItcQF7D0fm82KFOI8d58rkMqW58zmJr1PBeWn9qaX28v6K8aKnNykmHHu5U0oH4_VwcEY5r1Ga3dQHHNDcHUpOe1eYfAzdS2BH8aFKieMTfexVb3CA5kfG7dCPDdRCYOF2BtYGcqGZTn9m_P1RdGUO_zHmZuTvirczsK6fAQAA__8aQRw0"  ></a><p class="pgc-img-caption"></p></div><p data-track="230"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">为了买到帕博西尼，她专门前往香港。帕博西尼价格高昂，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一粒药1400元</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，一盒21粒，费用高达3万。</span></p><p data-track="231"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微咬紧牙关，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一口气买下了3盒帕博西尼</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，这些药物，已经成为她最后的希望。</span></p><p data-track="232"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">正如《人间世》节目组所说的那样：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“这就是我们和癌症抗争的现实，金钱，有时候代表着更多的机会。”</span></strong></p><blockquote class="pgc-blockquote-abstract"><p>对此，闫宏微深有体会，她说道：“病了以后才发现黄金算什么，黄金一点都不贵，这个药比黄金贵的多了去了，随便一个什么靶向药，都比黄金贵。”</p></blockquote><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Faf00b04d297d4e659f7dc14741479585%3Ffrom%3Darticle.detail%26_iz%3D31825&index=16" width="640" height="397" thumb_width="120" thumb_height="74" zip_src_path="eJzE0bFuwyAUheF3ubNtMMF2QIr6IG1VEcDObSEk-NKhkd-9UodWqjJlsPcjfTr6b5AyTngGfYOSwwz6GU5El1kzdhF9Q6kQmoRxamyKLJg8eUZpru25xvr6-S7CVaoPzszI-ZFLJ9TgpO87NQ7OtnKQrRxUt--expziwWRCG3zjPBkML4Vz0b_h12HX7kUH1R-tNpPXPv1aQckIGh5nYKmATiUe71bc_f_zM90k4mryyp9_Gz7OwLJ8BwAA__9EWh9C"  ></a><p class="pgc-img-caption"></p></div><h1 class="pgc-h-arrow-right" data-track="281">无力回天，病魔吞噬</h1><p data-track="235"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">此后两个月的时间，闫宏微每天都按时服药，内心充满着期待。她同家人说：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“万一出现一个奇迹呢？”</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">此外，闫宏微甚至还故作幽默地对记者说道：</span></p><blockquote class="pgc-blockquote-abstract"><p>“我现在想，等到你们拍完这个，要结束的时候，正好我要去复查了，这个药奇迹般地出现了效果，我的肿瘤在减少或者不动了，多好啊，一个美好的结局。”</p></blockquote><p data-track="237"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微的笑容依旧同从前一般灿烂，只是众人明白，其背后隐藏着怎样的苦涩。</span></p><p data-track="298"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">遗憾的是，闫宏微等来的奇迹并没有出现。</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F3c383391dc934ed3818b1a07f03ab60f%3Ffrom%3Darticle.detail%26_iz%3D31825&index=17" width="640" height="362" thumb_width="120" thumb_height="68" zip_src_path="eJzE0bFOwzAQxvF3uTmJnVwJtqWKBwGEHMdJD-y6dc4MVHl3JAYY6NQh3T_pp0__C_ChxAHMBUoOC5hnODCfFiPESTecCpNNFOfGpSh-poLTUrtjTfX5870L553-kAIdKkTdjk7jzo-oWjW0Vj5OEu3Qy-lpyinubWZywTejZ0vhpUjZ9W_0tcdWdQ9Q_cldfzcat5VfKyiZwMDtDKwVpEwzHa9W_Hco2Dz7-1TcjN749G_F2xlY1-8AAAD__zOmIYQ="  ></a><p class="pgc-img-caption"></p></div><p data-track="238"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">后来，闫宏微前往医院复查，看到自己的<span class="candidate-entity-word" data-gid="15881740" qid="6595508899678262531" mention-index="0">血小板</span>与血红蛋白都恢复正常。她大喜过望，口中念着：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“太棒了，太棒了。”</span></strong></p><p data-track="239"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">只是靶向药物是否有效，还需要等待最后的CT结果。而这个结果，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">成为压垮闫宏微一家的最后一根稻草。</span></strong></p><p data-track="240"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">CT结果显示：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微体内的癌细胞再次扩散</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，靶向药物治疗失败。纵使闫宏微再强大，却还是没有从死神手中夺回自己的生存权力。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F5716f3237f424010ad19fc3bf3948342%3Ffrom%3Darticle.detail%26_iz%3D31825&index=18" width="640" height="416" thumb_width="120" thumb_height="78" zip_src_path="eJzM0b1OwzAUQOF3uXMS_zZtLFU8CCDkunF6wa4b55qBKO-OxMDCgiIRuh_pG84MKeOAVzAzlBwmMI9wIbpNhrGbaigVQpswDo1LkQWbh55Rmmp3rbEe319lGHX3xtluL1qvpNp7LTUX3J5F5506edXpg9LywecUjzYTutA3554shqfCuWxf8OOoxEHuoLoHud1Wfq6gZAQD6xlYKqBLiaffPfxK_-XhZrL8MfFv6e-J6xlYls8AAAD___8SHPQ="  ></a><p class="pgc-img-caption"></p></div><p data-track="241"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微知道自己时日无多了</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，在生命的最后时刻，她选择与女儿、家人在一起。他们手牵手在林荫道上散步，一路说说笑笑。闫宏微的脸上，始终挂着灿烂的笑容。</span></p><p data-track="242"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">这时的闫宏微是最幸福的人，仿佛自己从未被病魔击垮。</span></p><p data-track="243"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">2月，闫宏微的病情再次恶化，住进医院。</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">此时的她脸色苍白、瘦弱不堪</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，却还是积极配合医生的治疗。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F1ea03462010d4c1d94dea38d6d8308ea%3Ffrom%3Darticle.detail%26_iz%3D31825&index=19" width="640" height="454" thumb_width="120" thumb_height="85" zip_src_path="eJzE0b9OwzAQx_F3uTmJ_2K5lioeBBAytkkP7Lp1zgxUeXckBhhg6pDuJ310v-8FasMZj-Au0FtewD3Agei0OMZOaqLaCX3FMk-hFpZ9mxOjuozhOOJ4_niT-ax375yJ5LnSRnLBow4i7nRMXtloolXcJn__2mrZ-0YYcppiIo_5sXMuzTN-7pWw8g6GX9ncTN7456cBekNwcD0D6wB06OXl34Z_lvw-3WJJeTt6Y_kn4vUMrOtXAAAA___yWyKS"  ></a><p class="pgc-img-caption"></p></div><p data-track="244"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">她充满爱意地看着正在病房内画着锦鲤的小女儿，同丈夫一起教她成语。一家三口人，开开心心地度过了一个情人节。</span></p><p data-track="245"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微无疑是痛苦的，却仍保持着生的希望，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">一句“我还有一口气在”</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，让在场的人泪流不止。</span></p><p data-track="246"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微丈夫吴载斌再次更新动态</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">：“望否极而云泰，何杳杳而无津”。</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp9.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F686aeece984d4e008631c42e34a648d6%3Ffrom%3Darticle.detail%26_iz%3D31825&index=20" width="640" height="500" thumb_width="120" thumb_height="94" zip_src_path="eJzk0bFOwzAQxvF3uTmJXdtYjqWKBwGEjHOkB3bdOmcGqrw7EgMMMHUIA_tJP933vwAfWn4Cf4FW0wL-Dg7Mp8ULcVJ24NKYQqE8D7Fk8XkruCx9PPbUn99eVDqb8VUK62xAjDg6MxmU0lm9i0ahNsEaN9nb51ryPlSmmHCYkAOl-yalso_0vtc7p26g-6bHP5O3fvqhg1YJPFzPwNpBqTTT8deMP7ZMoc64xZb6v8hfEa9nYF0_AgAA__9duSIy"  ></a><p class="pgc-img-caption"></p></div><p data-track="247"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">照片上的他紧紧握住穿着病号服的闫宏微的手，后来人们才知道，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">那是闫宏微坦然面对死亡的决心。</span></strong></p><p data-track="248"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">3月，同癌症抗争无数个日夜的励志故事，最终落下帷幕，闫宏微永远离开了这个世界，离开了家人，也离开了自己最放心不下的女儿。</span></p><blockquote class="pgc-blockquote-abstract"><p>“亲手把最心爱的人挂到墙上，所有的美好定格成冰冷的照片，从灵魂深处喷涌出来的悲伤，根本无法抑制……”</p></blockquote><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp9.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F7234c25982f44139acf38fbbc4e4f4f1%3Ffrom%3Darticle.detail%26_iz%3D31825&index=21" width="640" height="328" thumb_width="120" thumb_height="62" zip_src_path="eJzE0cFOhDAQxvF3mTNQaLsrbbLxQdSYUlt2tN0uZepBwrubeNCr4QD3SX6Z779AyjjiDfQCJYcZ9BNcie6zZuyuGkqF0CSMY2NTZMHk0TFKc21vNdbT5zsPk1QfLXvgQlp-Uj33UnZCGetF74fBSie99N2jzyleTCa0wTVvjgyG59K2_PyKXxfR9fwE1Z_Mz4fRYl_5pYKSETRsZ2CtgK4lDv-L-HN6yJK7yTv__NtwOwPr-h0AAP__41ojWw=="  ></a><p class="pgc-img-caption"></p></div><p data-track="250"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">从吴载斌的文字中，人们看到了何等的绝望。闫宏微离开了，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">这个世界又是否会留下她曾经的身影？</span></strong></p><p data-track="251"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">33岁女博士闫宏微赴美抗癌，这个故事一经播出，便引起了社会各界的关注。</span></p><p data-track="252"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">得知闫宏微离世的消息，网友们纷纷表示了自己的怀念：</span></p><blockquote class="pgc-blockquote-abstract"><p>“今天是《人间世》的最后一期更新，生活总有太多的不幸与意外，我们总是在寻找希望中被打得节节败退，微微老师，走好。”</p></blockquote><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Fd38b0fca298b4cc78eb12105b57050aa%3Ffrom%3Darticle.detail%26_iz%3D31825&index=22" width="640" height="450" thumb_width="120" thumb_height="84" zip_src_path="eJzk0cFOxCAUheF3ueu2UDrMUJKJD6LGAMN0rsLQ0osLm767iQvdmi7qwv1JvuT8C6SMA95BL1BymEE_wo1onDVjozg2lAqhSRiHxqXIgsmDZ5Tm2t1rrKf3VxGmQ__G2aVTll-dEb2yB-dOyttWtFxaeeKSG_NwzSmeTSZ0wTcXTwbDU-FcHF_w49y1Skiofujuz-R-X_m5gpIRNGxnYK2AbiXaX0b82u5x5b-RvyNuZ2BdPwMAAP__TX4kOg=="  ></a><p class="pgc-img-caption"></p></div><p data-track="254"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">是啊，生活从不缺少苦难，如闫宏微一般，面对困难迎难而上的勇者，才弥足珍贵。事实上，闫宏微同病魔斗争的历程，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">只不过是众多抗癌人的冰山一角。</span></strong></p><p data-track="255"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">相关数据显示，在2012年到2014年的时间里，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">中国癌症患者的人均就诊费用为上万美元</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">。而中国每年花费在治疗癌症上的费用，也达到了千亿。</span></p><blockquote class="pgc-blockquote-abstract"><p>正如《人间世2》总导演秦博所说：“医院里，钱经常会带来巨大的困扰。在<span class="candidate-entity-word" data-gid="6257134" qid="6587499112491390215" mention-index="0">ICU</span>，维持一个人的生命足以让他周围的人陷入巨大的困境，因为生死和金钱在这里直接挂钩。”</p></blockquote><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2Fce15688e09154d18a97567acf2c81abe%3Ffrom%3Darticle.detail%26_iz%3D31825&index=23" width="640" height="466" thumb_width="120" thumb_height="87" zip_src_path="eJzM0b1OwzAUxfF3uXMSf7R2HUsVDwIIua6bXrDrxrlmIMq7IzGwwJQhsB_pp6P_DLnggDewM9QSJ7CPcCW6T5axu9Qd5UroMqah8zmx6MoQGOWp9bcW2_H9VcZx379x5oNQ2pjAe6H2Z2Fcf1D64PxFeiPcKTxcSk5HVwh9DN05kMP4VDmX-gU_jjthpILmX9Aby88N1IJgYT0DSwN0ren0a8Uff76mfxNxM3q3rfwdcT0Dy_IZAAD__95iI9k="  ></a><p class="pgc-img-caption"></p></div><p data-track="257"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">在绝望的情景下，闫宏微及其家人仍然拼尽全力与癌症作斗争，又付出了多大的勇气。他们承受的困难与压力，无人敢想象。</span></p><p data-track="258"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">得到疾病与死亡之神的打击，闫宏微是不幸的；然而乐观、坚强、豁达的她，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">却永远成为了其他人抗癌道路上的向导与标杆。</span></strong></p><p data-track="259"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">能够获得幸福的家庭和众人的崇敬，也不枉闫宏微人间一遭。从前，普通家庭的人一旦患上癌症，一生将变得面目全非。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F890e06bf553e423dbcace7f67cb52d5c%3Ffrom%3Darticle.detail%26_iz%3D31825&index=24" width="640" height="387" thumb_width="120" thumb_height="73" zip_src_path="eJzE0UFPwyAYxvHv8p7bgjDYSrL4QdQYoLR7FcZGXzy49LubeNDEeNqhvT_JL0_-N8gFJzyDuUEtcQbzBCeiy2wYu8iOciW0GdPU-ZxYtGUKjPLc-nOL7fXjTcTrrn_n7NDzwLUblZJhJ-TgvPVhP-q9d0oMyj-OJaejLYQ-hm4IZDE-V86FfsXPo3w4CAXNr9xvJq_8-aWBWhAM3M_A0gCdanL_NhT676Hv7SYRV5PXPv1T8X4GluUrAAD__zrGJ-I="  ></a><p class="pgc-img-caption"></p></div><p data-track="260"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">治疗费、检查费、医药费……无数的花销如同一座座大山</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，将所有患者压得喘不过气。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">那些进口的天价靶向药，并不在医保的范围内，只能由患者自己承担。</span></p><p data-track="261"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">近几年来，政府时刻关注着医疗领域的相关问题。</span></p><p data-track="262"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">2021年12月，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">国家医保再次新增了74种药品</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，其中涉及肿瘤、罕见病、慢性病等多种疾病。</span></p><p data-track="263"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">从天价药品进医保的决定中，我们也能看到政府的决心。正如医保局代表所说的那样：</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">“每一个小小群体都不能被忽视。”</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F3be862bd10ed485fb286fbd9e68e7795%3Ffrom%3Darticle.detail%26_iz%3D31825&index=25" width="640" height="525" thumb_width="120" thumb_height="98" zip_src_path="eJzEk01uwyAQhe8ya9sQnBCMFPUgbVSBwc60EBI8dNHId6_6oy6aXaTG-9F8M-_Tu0DKOOIR9AVKRtAQTB49ozTV_bHG-vz2IsJ53b1y1lqvpLBuxb1bq81ghZKDdZ2Xym-33QYqKDlMoB_hQHSaNGOntqFUCE3CODZ9iuz29Q9DTnFnMmEffOM8GQxPhXMhn_F9166U-LzglyzkYug7P72fK6BDifZb4h8D1zl8zd4jh-XIVwb-l7yvfspzOwbm-SMAAP__NoIloQ=="  ></a><p class="pgc-img-caption"></p></div><p data-track="264"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微曾是小小群体中的一员，尽管在与病魔的抗争中，她以失败告终，但这个世界，却永远永远留下了她的足迹。</span></p><p data-track="289"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">她的坚强与不妥协，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">始终留在丈夫吴载斌的心底。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">只是，人生不走回头路，吴载斌的生活，也需要继续……</span></p><p data-track="265"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">2020年3月，吴载斌也公布了自己的新恋情。此消息一出舆论哗然。在部分人看来，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">闫宏微离世后仅一年</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">，丈夫便另寻新欢实在让人心寒。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp6.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F7e0d5d1080e0419ba4225eb9599b1b56%3Ffrom%3Darticle.detail%26_iz%3D31825&index=26" width="640" height="478" thumb_width="120" thumb_height="90" zip_src_path="eJzE0b9OwzAQx_F3uTmJ_zQOtaWKBwGE7MSkB3bdOmcGorw7EgMMdMqQ7Cd99L3fDCnjiBcwM5QcJjBPcCa6Toaxa9dQKoQ2YRybPkUWbB49ozTV_aXG-vb5LsOt1R-cPXg-qEHwI_e8FdrZVkrlnVZaO-FU9_iWUzzZTNgH3wyeLIbnwrnsXvHrdBBHqaD6k_Vu8sbNLxWUjGBgPQNLBXQu0d3dUP4L-rnd4pWH3eSto39XXM_AsnwHAAD___ERICo="  ></a><p class="pgc-img-caption"></p></div><p data-track="290"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">社交平台上瞬间涌入各种谩骂性的话语，吴载斌也震惊不已。后来，在与他人的交谈中，他透露了这件事情的来龙去脉。</span></p><p data-track="266"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">疫情期间，吴载斌腰椎不舒服，刚刚进行完手术，自己一人带着孩子，逐渐感觉力不从心。在网络上，一位女孩儿走进了吴载斌的世界。</span></p><p data-track="294"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">她作为一名护士，传授给吴载斌大量的护理知识，在相处过程中，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">二人逐渐产生感情。</span></strong></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp26.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F71c408567ca04255938c679222151bbd%3Ffrom%3Darticle.detail%26_iz%3D31825&index=27" width="640" height="403" thumb_width="120" thumb_height="76" zip_src_path="eJzM0UFOwzAQheG7zDqJnUmcxJYqDgIIOW5IB-y6dcYsqHJ3JBYsgFUlQvdP-vT0XyAmmukI5gI5-QXMPRyYT4sR4oRdxTEz2UhhrlwMwts0T4LjUrpjSeX57QX9udWvUvS1a-Wgut5Z2aJSuhlc12tErFU9jvu75xTDziYm56dqP7El_5ClxO6J3ndNPaCC4iZova38WEBOBAauZ2AtgA85jL9WbL7_-Zz-T8TN6B8R_1b-ing9A-v6EQAA__8oSBv3"  ></a><p class="pgc-img-caption"></p></div><p data-track="267"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">遗憾的是，吴载斌与女孩儿相隔甚远，在各方压力的作用下，网恋几个月的两人最终分手。</span></strong></p><p data-track="268"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">现如今，吴载斌仍然带着孩子，过着简单的单身生活。他偶然与朋友聚餐，闲暇之余，大多数时间都宅在家里。最初因思念妻子，吴载斌前往墓地的次数十分频繁。</span></p><p data-track="269"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">渐渐地，他减少了前往墓地的次数，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">保持两三个月一次的频率。</span></strong></p><p data-track="293"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">每次去看妻子时，吴载斌都会准备好足够多的祭品，在她墓地旁边，吴载斌似乎总有着说不完的话。</span></p><div class="pgc-img"><a class="image"  href="bytedance://large_image?url=https%3A%2F%2Fp3.toutiaoimg.com%2Flarge%2Ftos-cn-i-qvj2lq49k0%2F513c8b927bee4932947f3852fce2d00b%3Ffrom%3Darticle.detail%26_iz%3D31825&index=28" width="640" height="754" thumb_width="120" thumb_height="141" zip_src_path="eJzE0sFOwzAMBuB38bltMqfdmkoTDwITarK0MyTLljocmPruCDggwYke1qMv_yf79w1iopHO0N0gJz9B9wgn5svUCXFRFcfM1EcKY2VjEL5PoxMcp9KeSyqvby_or7V-laLZKNsajTvjXK0V6no3qLbBwTo8SmkehhTDvk9M1rvq6Lgn_5SlxO0zve_VpsUGih9ZrybfeedDATkRdLCcgbkAPuVgvjv8DPsal4UVf99g-_sky-P_WcZ6Mt6ZPszzRwAAAP__S3wh1Q=="  ></a><p class="pgc-img-caption"></p></div><p data-track="270"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">不可否认的是，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">吴载斌仍然深爱着闫宏微和孩子。</span></strong></p><p data-track="286"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">只是作为一个同样热爱世界的人，吴载斌依旧对新生活充满向往，</span><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">也从不否认自己对未来家庭的期待。</span></strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">他希望有一个稳定的家，一个爱着自己女儿的妻子。</span></p><p data-track="285"><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">逝者已矣，活着的人生活仍将继续，闫宏微在天堂应该也希望，丈夫带着她对生活的热爱，走入一个新的人生阶段吧。</span></p><h1 class="pgc-h-arrow-right" data-track="292">参考资料</h1><p data-track="272"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">[1]《恋爱婚姻家庭(上半月)》 2019年10月1日，《女博士带着爰情赴美自救：每一对夫妻都是生死之交》</span></strong></p><p data-track="308"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">[2]人物，2021年5月10日 ，《&lt;人间世&gt;之外，一个丈夫的选择》</span></strong></p><p data-track="274"><strong><span style="color: #3E3E3E; --tt-darkmode-color: #A3A3A3;">[2]《北京日报》，2019年3月21日，《&lt;人间世&gt;中抗癌的女博士走了！丈夫微博让人泪目》</span></strong></p></article>
     *
     *
     *                            <footer></footer>
     * @param authorInfo          {"avatar":"http:\/\/p1-dy.bytexservice.com\/large\/pgc-image\/8844dbca13044a75ba5718f3946e562b","g_composition":8,"g_source":2,"is_lite":1,"is_original":true,"media":{"id":1649063412450316,"v":false,"show_pgc_component":true,"avatar_url":"http:\/\/p1-dy.bytexservice.com\/large\/pgc-image\/8844dbca13044a75ba5718f3946e562b","description":"了解有趣的历史，且吸取精华的历史文化","name":"孤风婉史","can_be_praised":false,"praise_data":{},"user_verified":true,"auth_info":"优质历史领域创作者","pgc_custom_menu":"","creator_id":4129404096099192,"user_auth_info":"{\"auth_type\":\"0\",\"auth_info\":\"优质历史领域创作者\",\"other_auth\":{\"interest\":\"优质历史领域创作者\"}}","master_media_info":"","car_author":0},"media_user_id":"4129404096099192","name":"孤风婉史","publish_stamp":"1642130840","publish_time":"01-14 11:27","source":"孤风婉史","src_link":"","str_group_id":"7052548690233311756","str_item_id":"7052548690233311756","title":"上海33岁女博士闫宏微：赴美抗癌不幸病逝，今丈夫带幼女独自生活","video_count":0}
     */
    private void bindContent(NewDetailViewHolder newDetailViewHolder, String content, String authorInfo) {
        if (newDetailViewHolder == null) {
            return;
        }

        if (this.mArticle == null) {
            return;
        }

        newDetailViewHolder.l = false;
        newDetailViewHolder.m = true;
        ++newDetailViewHolder.token;
        newDetailViewHolder.mDetailScrollView.setVisibility(View.VISIBLE);
        if (this.mArticle == null) {
            return;
        }

        this.d(this.mArticle);
        this.h(newDetailViewHolder);
        String baseURL = "file:///android_asset/article/?item_id=" + this.mArticle.groupId + "&token=" + newDetailViewHolder.token;//file:///android_asset/article/?item_id=7052548690233311756&token=1
        String htmlAssetsDir = this.mAppData.getSSJSResAssetsDir() + "/v55";//file:///data/user/0/com.ss.android.article.browser/files/ss_js_res/asset/v55
        if (new File(htmlAssetsDir).exists()) {
            htmlAssetsDir = "file://" + htmlAssetsDir + "/";
        } else {
            try {
                JSONObject jsLoadFailJO = new JSONObject();
                jsLoadFailJO.put("jsPath", htmlAssetsDir);
                com.bytedance.article.common.a.g.a("js_load_fail", jsLoadFailJO);
            } catch (JSONException jsonException) {
            }
            htmlAssetsDir = "v55/";
        }
        if (android.support.design.a.isTest(this.getContext())) {
            String dir = AppData.getInstance().aI;
            if (!android.support.design.a.isTextEmpty(dir)) {
                htmlAssetsDir = dir;
            }
        }

        String androidJSPath = htmlAssetsDir + "js/android.js";
        String androidCssPath = htmlAssetsDir + "css/android.css";
        String libJSPath = htmlAssetsDir + "js/lib.js";
        StringBuilder contentBuilder = new StringBuilder();
        if (Logger.debug()) {
            Logger.v(NewArticleDetailFragment.TAG, "bindContent for " + this.mArticle.groupId + " " + htmlAssetsDir);
        }

        int userDigg = this.mAppData.mLoadImagePref;
        boolean isLoadImage4G = this.mAppData.getAbSettings().isLoadImage4G();
        NetworkType networkType = NetworkUtils.getNetworkType(this.mContext);
        String loadImage = "thumb";
        int showAvatar = 1;
        if (networkType == NetworkType.NONE) {
            showAvatar = 0;
            loadImage = "none";
        } else if (networkType == NetworkType.WIFI || userDigg == 1) {
            loadImage = "origin";
        } else if (networkType == NetworkType.MOBILE_4G && (isLoadImage4G)) {
            loadImage = "origin";
        } else if (userDigg == 2) {
            loadImage = "none";
            showAvatar = 0;
        }
        newDetailViewHolder.mDetailScrollView.setEnableDetectContentSizeChange("thumb".equals(loadImage));
        userDigg = 0;
        int userBury = 0;
        if (this.mArticle.userDigg) {
            userDigg = 1;
        }

        if (this.mArticle.userBury) {
            userBury = 1;
        }

        int v9 = this.mFontSizePref;
        String fontSize = null;
        int showVideo = DetailStyleConfig.b(v9) > 0
                ? ((int) UIUtils.sp2px(this.getContext(), ((float) DetailStyleConfig.b(v9))))
                : ((int) UIUtils.sp2px(this.getContext(), ((float) ArticleConstants.K[v9])));
        if (v9 == 0) {
            fontSize = "m_" + showVideo;
        } else if (v9 == 1) {
            fontSize = "s_" + showVideo;
        } else if (v9 == 2) {
            fontSize = "l_" + showVideo;
        } else if (v9 == 3) {
            fontSize = "xl_" + showVideo;
        }//fontSize = "m_42"

        contentBuilder.append("<html><head>");
        contentBuilder.append("<meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1.0\" >\n");
        if (AppData.isNightMode()) {
            contentBuilder.append("<meta name=\"night_mode\" content=\"1\" >\n");
        }

        showVideo = 0;
        if (NetworkUtils.isNetworkAvailable(this.mContext)) {
            showVideo = 1;
        }

        String urlPrefix = null;
        int aid = this.mAppData.getAppContext().getAid();//1212
        if (aid != 13 && aid > 0) {
            urlPrefix = "content://com.ss.android.article.base.ImageProvider" + aid + "/";
        }
        int v17 = this.mAppData.lazyLoadPolicy;
        int closeLazyLoad = 0;
        if (v17 == 1 || v17 == 2) {
            if (v17 == 2
                    && (networkType == NetworkType.MOBILE_3G || networkType == NetworkType.WIFI)) {
                closeLazyLoad = 1;
            }
            if (v17 != 1) {
            } else {
                if (networkType == NetworkType.WIFI) {
                    closeLazyLoad = 1;
                }
            }
        }
        contentBuilder.append("<meta name=\"show_avatar\" content=\"").append(showAvatar).append("\" >\n");
        contentBuilder.append("<meta name=\"show_video\" content=\"").append(showVideo).append("\" >\n");
        contentBuilder.append("<meta name=\"load_image\" content=\"").append(loadImage).append("\" >\n");
        contentBuilder.append("<meta name=\"digg_count\" content=\"").append(this.mArticle.diggCount).append("\" >\n");
        contentBuilder.append("<meta name=\"bury_count\" content=\"").append(this.mArticle.buryCount).append("\" >\n");
        contentBuilder.append("<meta name=\"user_digg\" content=\"").append(userDigg).append("\" >\n");
        contentBuilder.append("<meta name=\"user_bury\" content=\"").append(userBury).append("\" >\n");
        contentBuilder.append("<meta name=\"font_size\" content=\"").append(fontSize).append("\" >\n");
        contentBuilder.append("<meta name=\"group_id\" content=\"").append(this.mArticle.groupId).append("\" >\n");
        contentBuilder.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
        contentBuilder.append(androidCssPath);
        contentBuilder.append("\" />\n");
        if (urlPrefix != null || closeLazyLoad != 0) {
            contentBuilder.append("<script type=\"text/javascript\">\n");
            if (urlPrefix != null) {
                contentBuilder.append("  var url_prefix = \"" + urlPrefix + "\";\n");
            }
            if (closeLazyLoad != 0) {
                contentBuilder.append("  var close_lazyload = true;\n");
            }

            contentBuilder.append("</script>\n");
        }

        contentBuilder.append("</head>");
        String[] v4_2 = fontSize.split("_");
        htmlAssetsDir = "";
        if (v4_2 != null && v4_2.length > 0) {
            htmlAssetsDir = "font_" + v4_2[0];
        }

        if (AppData.isNightMode()) {
            contentBuilder.append("<body class=\"night ").append(htmlAssetsDir).append("\">");
        } else {
            contentBuilder.append("<body class=\"").append(htmlAssetsDir).append("\">");
        }

        contentBuilder.append(content);
        if (android.support.design.a.isTextEmpty(authorInfo)) {
        } else {
            try {
                JSONObject authorInfoJO = new JSONObject(authorInfo);
                authorInfoJO.put("is_subscribed", SubscribeManager.getInstance().a(this.mNewDetailContext.articleDetail.mediaId, this.mArticle.ah));
                boolean isAuthor;
                if (!this.mSpipe.isLogin) {
                    isAuthor = false;
                } else if (this.mSpipe.pgcMediaid == this.mNewDetailContext.articleDetail.mediaId) {
                    isAuthor = true;
                } else {
                    isAuthor = false;
                }
                authorInfoJO.put("is_author", isAuthor);
                authorInfoJO.put("gid", this.mArticle.groupId);
                authorInfoJO.put("item_id", this.mArticle.itemId);
                htmlAssetsDir = this.mAppData.getAppSettings().getH5Settings();
                if (!android.support.design.a.isTextEmpty(htmlAssetsDir)) {
                    authorInfoJO.put("h5_settings", new JSONObject(htmlAssetsDir).toString());
                }

                Context context = this.mContext.getApplicationContext();
                if ((context instanceof BizApplication)) {
                    authorInfoJO.put("ab_client", ((BizApplication) context).getAbClient());
                }

                authorInfoJO.put("is_gallery", this.mPresenter.mNewDetailContext.isGallery());
                if (!TextUtils.isEmpty(this.mNewDetailContext.articleDetail.novelDataJson)) {
                    authorInfoJO.put("novel_data", new JSONObject(this.mNewDetailContext.articleDetail.novelDataJson));
                }

                contentBuilder.append("<script type=\"text/javascript\">window.h5_extra = ");
                if (authorInfoJO != null) {
                    authorInfo = authorInfoJO.toString();
                }
                contentBuilder.append(authorInfo).append("; </script>");
            } catch (JSONException jsonException) {
            }
        }
        if (!android.support.design.a.isTextEmpty(DetailStyleConfig.getCustomStyle())) {
            contentBuilder.append("<script type=\"text/javascript\">window.custom_style = ")
                    .append(DetailStyleConfig.getCustomStyle())
                    .append("; </script>");
        }

        if (this.mArticle.zzcomment != null && !this.mArticle.zzcomment.isEmpty()) {
            JSONArray ja = new JSONArray();
            Iterator<Comment> iterator = this.mArticle.zzcomment.iterator();
            while (iterator.hasNext()) {
                ja.put(iterator.next().toAbstractJSON());
            }
            contentBuilder.append("<script type=\"text/javascript\">window.zz_comments = ")
                    .append(ja.toString())
                    .append("; </script>");
        }

        contentBuilder.append("<script type=\"text/javascript\" src=\"");
        contentBuilder.append(libJSPath);
        contentBuilder.append("\"></script>");
        contentBuilder.append("<script type=\"text/javascript\" src=\"");
        contentBuilder.append(androidJSPath);
        contentBuilder.append("\" ></script>");
        contentBuilder.append("</body></html>");
        newDetailViewHolder.mWebView.loadDataWithBaseURL(baseURL, contentBuilder.toString(), "text/html", "utf-8", baseURL);
        newDetailViewHolder.mWebView.setTag(com.ss.android.article.browser.R.id.webview_transform_key, Boolean.TRUE);
        newDetailViewHolder.mWebView.setTag(com.ss.android.article.browser.R.id.webview_client_transform_key, null);
        newDetailViewHolder.mWebView.setTag(com.ss.android.article.browser.R.id.webview_support_js, null);
        newDetailViewHolder.mWebView.setTag(com.ss.android.article.browser.R.id.webview_clear_history_key, baseURL);
        this.isWebViewDataLoaded = true;
        this.e(baseURL);
        if (this.mNewDetailContext.articleDetail.novelData != null) {
            if (this.mSerialCatalogView == null) {
                this.mSerialCatalogView = (SerialCatalogView) ((ViewStub) this.findView(com.ss.android.article.browser.R.id.serial_catalog_view_stub)).inflate();
                this.mSerialCatalogView.setVisibility(View.INVISIBLE);
            }

            final SerialCatalogView serialCatalogView = this.mSerialCatalogView;
            final ArticleDetail.NovelData novelData = this.mNewDetailContext.articleDetail.novelData;
            serialCatalogView.mCatalogTv.setText(serialCatalogView.getResources().getString(com.ss.android.article.browser.R.string.catalog, new Object[]{Integer.valueOf(novelData.serialCount)}));
            TextView preChapterTv = serialCatalogView.mPreChapterTv;
            boolean isPreEnable = !TextUtils.isEmpty(novelData.preGroupUrl) ? true : false;
            preChapterTv.setEnabled(isPreEnable);
            TextView nextChapterTv = serialCatalogView.mNextChapterTv;
            boolean isNextEnable = !TextUtils.isEmpty(novelData.nextGroupUrl) ? true : false;
            nextChapterTv.setEnabled(isNextEnable);
            serialCatalogView.mPreChapterTv.setOnClickListener(new View.OnClickListener() {

                public void onClick(View view) {
                    AdsAppActivity.openUrl(serialCatalogView.getContext(), novelData.preGroupUrl, null);
                    serialCatalogView.onEvent("click_pre_group", itemId, articleGroupItemId);
                }
            });
            serialCatalogView.mNextChapterTv.setOnClickListener(new View.OnClickListener() {

                public void onClick(View arg7) {
                    AdsAppActivity.openUrl(serialCatalogView.getContext(), novelData.nextGroupUrl, null);
                    serialCatalogView.onEvent("click_next_group", itemId, articleGroupItemId);
                }
            });
            serialCatalogView.mCatalogTv.setOnClickListener(new View.OnClickListener() {

                public void onClick(View view) {
                    AdsAppActivity.openUrl(serialCatalogView.getContext(), novelData.url, null);
                    serialCatalogView.onEvent("click_catalog", itemId, articleGroupItemId);
                }
            });
        }
    }

    private void footerAdaptNightMode(NewDetailViewHolder newDetailViewHolder, boolean isNightMode) {
        if (newDetailViewHolder != null && newDetailViewHolder.isNightMode != isNightMode) {
            newDetailViewHolder.isNightMode = isNightMode;
            newDetailViewHolder.mNewDetailPageExtra.mSofaText.setTextColor(this.mResources.getColor(com.ss.android.article.browser.R.color.ssxinzi3));
            newDetailViewHolder.mMoreTextView.setTextColor(this.getResources().getColor(com.ss.android.article.browser.R.color.ly));
            newDetailViewHolder.mMoreTextView.setBackgroundResource(com.ss.android.article.browser.R.color.qm);
            if (newDetailViewHolder.mFooter.mFooterTopDivider != null) {
                newDetailViewHolder.mFooter.mFooterTopDivider.setBackgroundResource(com.ss.android.article.browser.R.color.gq);
            }

            if (newDetailViewHolder.mFooter.mFooterBottomDivider != null) {
                newDetailViewHolder.mFooter.mFooterBottomDivider.setBackgroundResource(com.ss.android.article.browser.R.color.gq);
            }
        }
    }

    private void setUserAgent(Article article, WebView webView) {
        if (webView != null) {
            String userAgent = this.mCustomUserAgent;
            if (article != null
                    && article.hasArticleUrl()
                    && article.e()) {
                userAgent = this.mOriginUserAgent;
            }

            if (android.support.design.a.isTextEmpty(userAgent)) {
                return;
            }
            webView.getSettings().setUserAgentString(userAgent);
        }
    }

    private void trackAdShow(BaseAdsData baseAdsData) {
        if (baseAdsData != null
                && baseAdsData.isValid()
                && baseAdsData.K) {
            BaseAdsData.trackAdShow(this.mContext, "detail_ad", baseAdsData, 1);
        }
    }

    private void a(final String arg10, String arg11, final long mediaId, boolean arg14) {
        if (!this.isFinishing()
                && !this.au
                && !android.support.design.a.isTextEmpty(arg10)
                && !android.support.design.a.isTextEmpty(arg11)
                && mediaId > 0) {
            this.au = true;
            FragmentActivity fragmentActivity = this.getActivity();
            Uri v1 = Uri.parse(arg11);
            View.OnClickListener onClickListener = new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    JSONObject jsonObject = new JSONObject();
                    try {
                        jsonObject.put("item_id", NewArticleDetailFragment.this.mArticle.itemId);
                        jsonObject.put("media_id", mediaId);
                    } catch (JSONException jsonException) {
                        jsonException.printStackTrace();
                    }
                    NewArticleDetailFragment.this.onEvent2("click_titlebar_pgc");
                    PgcActivity.startActivity(
                            NewArticleDetailFragment.this.mContext,
                            mediaId,
                            NewArticleDetailFragment.this.mArticle.itemId,
                            "article_top_titlebar");
                }
            };
            ((NewDetailActivity) fragmentActivity).j = arg14;
            if (arg14) {
                ((NewDetailActivity) fragmentActivity).mDetailTitleBar.setPgcLayoutVisibility(4);
            } else {
                final DetailTitleBar detailTitleBar = ((NewDetailActivity) fragmentActivity).mDetailTitleBar;
                detailTitleBar.mPgcLayout.setAlpha(0f);
                detailTitleBar.mPgcLayout.animate()
                        .alpha(1f)
                        .setStartDelay(50)
                        .setListener(new AnimatorListenerAdapter() {
                            public final void onAnimationStart(Animator animator) {
                                if (detailTitleBar.mPgcLayout.getVisibility() != View.VISIBLE) {
                                    detailTitleBar.mPgcLayout.setVisibility(View.VISIBLE);
                                }
                            }
                        }).start();
            }

            ((NewDetailActivity) fragmentActivity).mDetailTitleBar.setPgcName(((CharSequence) arg10));
            ((NewDetailActivity) fragmentActivity).mDetailTitleBar.setPgcAvatar(v1);
            if (((NewDetailActivity) fragmentActivity).mAppData.getAbSettings().isQQTopShare()) {
                return;
            }

            if (((NewDetailActivity) fragmentActivity).mAppData.getAbSettings().isTopShare()) {
                return;
            }

            ((NewDetailActivity) fragmentActivity).mDetailTitleBar.setPgcClickListener(onClickListener);
        }
    }

    private void a(boolean arg5, int arg6, boolean arg7) {
        if (!this.isFinishing()) {
            if (mNewDetailViewHolder == null) {
                return;
            }

            int v0 = mNewDetailViewHolder.mListView.getHeaderViewsCount();
            Article v3 = this.mArticle;
            if (v3 != null && (v3.disableScrollOver()) && (arg7)) {
                arg6 = 2;
            }

            switch (arg6) {
                case 4: {
                    v0 = 1;
                    break;
                }
            }

            try {
                mNewDetailViewHolder.mListView.setSelection(v0);
            } catch (Exception exception) {
            }

            if (mNewDetailViewHolder.mNewDetailAdapter.h) {
                mNewDetailViewHolder.mNewDetailAdapter.h = false;
            }

            if (arg5) {
                this.aw = true;
                mNewDetailViewHolder.mDetailScrollView.checkOpenDrawer();
            } else {
                this.R();
            }
        }
    }

    final void showImageToast(int drawableResId, int textId) {
        if (!this.isFinishing()) {
            android.support.design.a.showImageToast(this.getContext(), textId, drawableResId);
        }
    }

    public final int getLayoutResId() {
        return com.ss.android.article.browser.R.layout.new_article_detail_fragment;
    }

    @NonNull
    public final ArticleDetailCommentPresenter createPresenter(Context context) {
        return new ArticleDetailCommentPresenter(context,
                ((NewDetailActivity) this.getActivity()).getNewDetailContext(),
                this.mNewDetailViewHolder,
                ((NewDetailActivity) this.getActivity()).mPresenter.mCommonBizInteractor);
    }

    public final void webviewContentResize(int newheight) {
        if (this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mWebView != null) {
            int v0 = Math.min(((int) ((float) newheight * UserAgentCompat.getScale(this.mNewDetailViewHolder.mWebView))),
                    this.mNewDetailViewHolder.mDetailScrollView.getHeight());
            if (this.mNewDetailViewHolder.mWebView.getLayoutParams().height < v0) {
                this.mNewDetailViewHolder.mWebView.getLayoutParams().height = v0;
                this.mNewDetailViewHolder.mWebView.requestLayout();
            }
        }
    }

    public final void onRemoteImageLoaded(long imageItemId, int index, boolean validResult, boolean isOrigin) {
        if (!this.isFinishing() && imageItemId > 0 && index >= 0) {
            if (Logger.debug()) {
                Logger.v(NewArticleDetailFragment.TAG, "onRemoteImageLoaded " + imageItemId + " " + index + " " + validResult + " " + isOrigin);
            }
            if (mNewDetailViewHolder == null) {
                return;
            }

            long itemId = this.mArticle != null ? this.mArticle.groupId : this.itemId;
            if (Logger.debug()) {
                Logger.v(NewArticleDetailFragment.TAG, "== check image_load_cb " + imageItemId + " " + index + " " + itemId + " " + mNewDetailViewHolder.l);
            }

            if (itemId != imageItemId) {
                return;
            }

            if (!mNewDetailViewHolder.m) {
                return;
            }
            LoadUrlUtils.loadUrl(mNewDetailViewHolder.mWebView, "javascript:image_load_cb(" + index + ", " + (validResult ? "true" : "false") + ", " + (isOrigin ? "true" : "false") + ")");
        }
    }

    public final void initView(View view) {
        this.mRootView = ((ViewGroup) view);
        this.mFullscreenVideoFrame = (FullscreenVideoFrame) this.findView(com.ss.android.article.browser.R.id.customview_layout);
        this.mTopVideoHolder = (FrameLayout) this.findView(com.ss.android.article.browser.R.id.top_video_holder);
        this.mProgressBar = (ProgressBar) this.findView(com.ss.android.article.browser.R.id.ss_htmlprogessbar);
        this.mSwipeOverlayFrameLayout = (SwipeOverlayFrameLayout) this.findView(com.ss.android.article.browser.R.id.swipe_overlay);
        this.mWebContainer = (FrameLayout) this.findView(com.ss.android.article.browser.R.id.web_container);
        this.mNewDetailViewHolder.mDetailScrollView = (DetailScrollView) this.findView(com.ss.android.article.browser.R.id.webview_layout);
        this.mNewDetailViewHolder.mDetailScrollView.setVerticalScrollBarEnabled(true);
        this.mNewDetailViewHolder.mWebView = (com.ss.android.article.base.ui.ScrollListenerWebView) this.findView(com.ss.android.article.browser.R.id.top_webview);
        this.mNewDetailViewHolder.mListView = (ListView) this.findView(com.ss.android.article.browser.R.id.bottom_listview);
        this.findView(com.ss.android.article.browser.R.id.bottom_listview_layout);
        this.mNewDetailViewHolder.mNightModeOverlay = this.findView(com.ss.android.article.browser.R.id.night_mode_overlay);
        LayoutInflater inflater = LayoutInflater.from(this.getContext());
        View footerView = inflater.inflate(com.ss.android.article.browser.R.layout.ss_new_comment_footer, this.mNewDetailViewHolder.mListView, false);
        this.mNewDetailViewHolder.mFooter = new Footer(footerView.findViewById(com.ss.android.article.browser.R.id.ss_footer_content));
        this.mNewDetailViewHolder.mFooter.hideFooterContent();
        this.mNewDetailViewHolder.mMoreTextView = footerView.findViewById(com.ss.android.article.browser.R.id.ss_more);
        this.mNewDetailViewHolder.mListView.addFooterView(footerView, null, false);
        View header2 = inflater.inflate(com.ss.android.article.browser.R.layout.detail_info_first_header2, this.mNewDetailViewHolder.mListView, false);
        View header = inflater.inflate(com.ss.android.article.browser.R.layout.new_article_detail_info_second_header, this.mNewDetailViewHolder.mListView, false);
        this.mNewDetailViewHolder.mDetailScrollView.mDetailInfoFirstHeader2 = header2;
        this.mNewDetailViewHolder.mNewDetailPageExtra = new NewDetailPageExtra(this.getActivity(), ((LinearLayout) header2), header);
        this.mNewDetailViewHolder.mListView.addHeaderView(header2, null, false);
        this.mNewDetailViewHolder.mListView.addHeaderView(header, null, false);
    }

    public final void onShowCustomView(View arg5, WebChromeClient.CustomViewCallback customViewCallback) {
        if (this.mAllowHtmlVideo) {
            try {
                if (this.mCustomView != null) {
                    customViewCallback.onCustomViewHidden();
                    return;
                }

                this.mCustomViewCallback = customViewCallback;
                this.mFullscreenVideoFrame.addView(arg5);
                UIUtils.requestActivityOrientation(((NewDetailActivity) this.getActivity()), true);
                this.mCustomView = arg5;
                if (!this.isFinishing() && this.mCustomView != null) {
                    if (this.getCommentMode() == 0) {
                        ((NewDetailActivity) this.getActivity()).setDetailTitleBarVisible(false);
                    }

                    ((NewDetailActivity) this.getActivity()).setDetailToolBarVisible(false);
                }

                this.mFullscreenVideoFrame.setVisibility(View.VISIBLE);
                this.mFullscreenVideoFrame.requestFocus();
            } catch (Throwable v0) {
                Logger.e(NewArticleDetailFragment.TAG, "exception in : client_onHideCustomView : " + v0.toString());
            }
        }
    }

    public final void onDomReady(WebView webView) {
    }

    public final void onProgressChanged(WebView webView, int progress) {
        if (!this.isFinishing()) {
            if (mNewDetailViewHolder != null && mNewDetailViewHolder.mWebView == webView) {
                if (this.U) {
                    this.hideProgressBar();
                    if (progress >= 100) {
                        this.mRootView.setVisibility(View.VISIBLE);
                        ((NewDetailActivity) this.getActivity()).inflatDetailErrorView().hideSelf();
                    }
                } else if (progress >= 100) {
                    this.hideProgressBar();
                } else {
                    this.showLoadingProgress(progress);
                }
            }
        }
    }

    public final void a(Comment comment) {
        if (!this.isFinishing()) {
            NewDetailViewHolder newDetailViewHolder = this.mNewDetailViewHolder;
            if (newDetailViewHolder != null) {
                if (mArticle != null && comment != null) {
                    boolean v0 = mArticle.groupId == comment.groupId && mArticle.itemId == comment.itemId;
                    if (!v0) {
                        v0 = mArticle.getItemKey().equals(comment.itemKey);
                    }

                    if (!v0) {
                        return;
                    }

                    if (android.support.design.a.isTextEmpty(comment.text)) {
                        return;
                    }

                    CommentTabCache commentTabCache = this.createCommentTabCache(this.itemId, this.mNewDetailViewHolder);
                    ArticleTabComment articleTabComment = commentTabCache.mArticleTabComments[0];
                    articleTabComment.commentWrapperList.add(0, CommentWrapper.fromComment(comment));
                    if (articleTabComment.totalNumber >= 0) {
                        ++articleTabComment.totalNumber;
                    }
                    ArticleTabComment articleTabComment1 = commentTabCache.mArticleTabComments[1];
                    articleTabComment1.commentWrapperList.add(0, CommentWrapper.fromComment(comment));
                    if (articleTabComment1.totalNumber >= 0) {
                        ++articleTabComment1.totalNumber;
                    }

                    ++mArticle.commentCount;
                    if (newDetailViewHolder.mCommentTabCache == commentTabCache) {
                        newDetailViewHolder.mNewDetailPageExtra.setSofaLayoutVisibility(false);
                        newDetailViewHolder.mNewDetailAdapter.addAllComment(articleTabComment.commentWrapperList);
                        newDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                        this.initDetailTitleBar(mArticle);
                    }
                    this.a(true, 2, true);
                    if (this.aG <= 0) {
                        return;
                    }
                    this.mPresenter.mDetailWebInteractor.mNewArticleDetailTTAndroidObject.a(this.aG, comment.commentId);
                }
            }
        }
    }

    public final void onCommentLoaded(CommentFetcher commentFetcher, boolean arg14) {
        if (!this.isFinishing() && commentFetcher != null && commentFetcher.article != null && commentFetcher.a == this.mNewDetailViewHolder.mCommentTabCache.mArticleTabComments[commentFetcher.tabIndex].counter) {
            int v0 = commentFetcher.tabIndex != 0 || (this.p()) ? 0 : 1;
            long v2 = commentFetcher.article.groupId;
            long v4 = commentFetcher.article.itemId;
            if (Logger.debug()) {
                Logger.d(NewArticleDetailFragment.TAG, "onCommentLoaded " + v2 + " " + commentFetcher.tabIndex + " " + commentFetcher.offset + " " + arg14);
            }

            mNewDetailViewHolder.mCommentTabCache.load[commentFetcher.tabIndex] = false;
            if (!arg14) {
                if (mNewDetailViewHolder == null) {
                    return;
                }

                if (v0 == 0) {
                    return;
                }

                if (commentFetcher.errorCode == 12) {
                    this.checkNetworkAndShowNoNetView();
                    return;
                }

                mNewDetailViewHolder.mFooter.switchToError(com.ss.android.article.browser.R.string.ss_error_unknown);
                return;
            }

            ArticleTabComment articleTabComment = this.mNewDetailViewHolder.mCommentTabCache.mArticleTabComments[commentFetcher.tabIndex];
            if (articleTabComment.h <= 0) {
                articleTabComment.h = System.currentTimeMillis();
            }

            articleTabComment.copyAllComment(commentFetcher.articleTabComment, 1);
            NewArticleDetailFragment.a(articleTabComment.commentWrapperList);
            articleTabComment.offset += commentFetcher.j;
            if (articleTabComment.commentWrapperList.isEmpty()) {
                articleTabComment.hasMore = false;
            }

            int v1 = articleTabComment.commentWrapperList.size() == 0 ? 1 : 0;
            if (v1 == 0) {
                if (v0 == 0) {
                } else {
                    if ((articleTabComment.detailNoComment) && !mNewDetailViewHolder.everEnterComment) {
                        mNewDetailViewHolder.mFooter.setViewMoreText(com.ss.android.article.browser.R.string.label_click_to_view_comments);
                        mNewDetailViewHolder.mFooter.switchToMoreContent();
                    } else {
                        mNewDetailViewHolder.mFooter.setViewMoreText(com.ss.android.article.browser.R.string.ss_load_more);
                        if (articleTabComment.hasMore) {
                            mNewDetailViewHolder.mFooter.switchToMoreContent();
                        } else {
                            mNewDetailViewHolder.mFooter.hideFooterContent();
                        }
                    }
                }
            } else if (v0 != 0) {
                mNewDetailViewHolder.mFooter.hideFooterContent();
                v1 = (articleTabComment.banComment) || (commentFetcher.article.mBanComment) ? 1 : 0;
                NewDetailPageExtra v8 = mNewDetailViewHolder.mNewDetailPageExtra;
                boolean v1_1 = v1 == 0;
                v8.setSofaLayoutVisibility(v1_1);
            }

            label_105:
            if (v0 != 0) {
                v1 = 0;
                if (!articleTabComment.detailNoComment || (mNewDetailViewHolder.everEnterComment)) {
                    mNewDetailViewHolder.mNewDetailAdapter.addAllComment(articleTabComment.commentWrapperList);
                    if (commentFetcher.topCommentId > 0) {
                        v1 = 1;
                    }
                } else {
                    mNewDetailViewHolder.mNewDetailAdapter.addAllComment((List) null);
                }

                mNewDetailViewHolder.mNewDetailAdapter.i = articleTabComment.goTopicDetail;
                mNewDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                if (v1 == 0) {
                } else {
                    v1 = mNewDetailViewHolder.mListView.getHeaderViewsCount();
                    try {
                        mNewDetailViewHolder.mListView.setSelection(v1);
                    } catch (Exception v1_2) {
                    }
                }
            }
            if (articleTabComment.totalNumber >= 0 && commentFetcher.article != null) {
                if (articleTabComment.totalNumber < articleTabComment.commentWrapperList.size()) {
                    articleTabComment.totalNumber = articleTabComment.commentWrapperList.size();
                }

                if (commentFetcher.article.commentCount == articleTabComment.totalNumber) {
                } else {
                    commentFetcher.article.commentCount = articleTabComment.totalNumber;
                    DBHelper.getInstance(this.mContext).a(v2, v4, articleTabComment.totalNumber);
                    NewDetailViewHolder v1_3 = this.mNewDetailViewHolder;
                    Article v2_1 = this.mArticle;
                    if (v1_3 == null) {
                    } else if (v2_1 == null) {
                    } else if (v2_1 != commentFetcher.article) {
                    } else {
                        if (articleTabComment.banComment) {
                            commentFetcher.article.mBanComment = true;
                        }

                        if (v0 == 0) {
                        } else {
                            this.initDetailTitleBar(v2_1);
                        }
                    }
                }
            }
            if (v0 != 0 && (this.mNewDetailContext.isJumpComment)) {
                this.mNewDetailContext.isJumpComment = false;
                if (!android.support.design.a.isTextEmpty(this.mNewDetailContext.growthFrom)) {
                    MobClickCombiner.onEvent(this.getContext(), "enter_comment", this.mNewDetailContext.growthFrom);
                }

                this.a(true, 4, true);
            }

            if (this.mNewDetailContext.showWriteCommentDialog) {
                this.mNewDetailContext.showWriteCommentDialog = false;
                this.r();
            }
        }
    }

    final void a(NewDetailViewHolder newDetailViewHolder) {
        if (newDetailViewHolder != null && newDetailViewHolder.mNewDetailPageExtra != null) {
            this.checkAndReportConcernWordsShow(newDetailViewHolder);
            this.checkAndReportLikeAndRewardsShow(newDetailViewHolder);
            this.checkAndReportDetailAdShow(newDetailViewHolder);
            this.checkAndShowCommentShow(newDetailViewHolder);
            this.checkAndReportRelatedArticleShow(newDetailViewHolder);
            if (newDetailViewHolder.mNewDetailPageExtra != null) {
                newDetailViewHolder.mNewDetailPageExtra.a(this.E);
            }

            if (newDetailViewHolder.mNewDetailAdapter.h) {
                newDetailViewHolder.mNewDetailAdapter.h = false;
            }

            NewArticleDetailFragment.b(newDetailViewHolder);
        }
    }

    public final void onArticleInfoLoaded(Article article, ArticleInfo articleInfo) {
        boolean v2_2;
        boolean v0 = true;
        this.initDetailTitleBar(article);
        NewDetailViewHolder newDetailViewHolder = this.mNewDetailViewHolder;
        this.mLandingPageUrl = articleInfo.landingPageUrl;
        if (newDetailViewHolder == null) {
        } else {
            String webViewTrackKey = articleInfo.webViewTrackKey;
            if (!android.support.design.a.isTextEmpty(webViewTrackKey)) {
                newDetailViewHolder.mWapStatHelper.mWebViewTrackKey = webViewTrackKey;
            }

            if (article.delete) {
                if (this.isFinishing()) {
                    return;
                }

                ((NewDetailActivity) this.getActivity()).switchToArticleDeleted(article);
                return;
            }

            if ((android.support.design.a.isTextEmpty(articleInfo.context)) && (android.support.design.a.isTextEmpty(articleInfo.script))) {
            } else if (!newDetailViewHolder.l) {
            } else {
                webViewTrackKey = NewArticleDetailFragment.i(newDetailViewHolder.mWebView.getOriginalUrl());
                int v3 = webViewTrackKey == null || !webViewTrackKey.startsWith("file:///android_asset/article/") ? 0 : 1;
                int v2_1 = v3 != 0 || (newDetailViewHolder.mWebView.canGoBack()) || !article.hasArticleUrl() || webViewTrackKey == null || !MediaAppUtil.a(webViewTrackKey, article.articleUrl) ? v3 : 1;
                if (v3 == 0 && v2_1 == 0) {
                } else if (articleInfo == null) {
                } else if (newDetailViewHolder == null) {
                } else {
                    webViewTrackKey = articleInfo.context;
                    if (v3 == 0 || (android.support.design.a.isTextEmpty(webViewTrackKey))) {
                        v2_2 = false;
                    } else {
                        LoadUrlUtils.loadUrl(newDetailViewHolder.mWebView, "javascript:insertDiv(" + webViewTrackKey + ")");
                        v2_2 = true;
                    }

                    if (android.support.design.a.isTextEmpty(articleInfo.script)) {
                        v0 = false;
                    }

                    try {
                        LoadUrlUtils.loadUrl(newDetailViewHolder.mWebView, "javascript:" + articleInfo.script);
                    } catch (Exception v1) {
                        Logger.w(NewArticleDetailFragment.TAG, "load info script exception: " + v1);
                    }

                    if (Logger.debug()) {
                        Logger.v(NewArticleDetailFragment.TAG, "embedContextInfo " + this.itemId + " " + v2_2 + " " + v0);
                    }
                }
            }

            newDetailViewHolder.mNewDetailPageExtra.initExtras(articleInfo, this.mNewDetailContext.adId, new View.OnClickListener() {
                @Override
                public final void onClick(View arg13) {
                    if (mNewDetailViewHolder != null) {
                        ArticleInfo articleInfo1 = mNewDetailViewHolder.mNewDetailPageExtra.mArticleInfo;
                        if (articleInfo1 != null) {
                            NewArticleDetailFragment.this.reportEvent("like");
                            int v0_2 = !articleInfo1.isUserLike() ? 1 : 0;
                            NewDetailViewHolder v4 = NewArticleDetailFragment.this.mNewDetailViewHolder;
                            if (v4 == null) {
                                return;
                            }

                            ArticleInfo v5 = v4.mNewDetailPageExtra.mArticleInfo;
                            Article v6 = v4.mNewDetailPageExtra.mArticle;
                            if (v6 == null) {
                                return;
                            }

                            if (v5 == null) {
                                return;
                            }

                            if (v0_2 != 0) {
                                v5.increaseUserLikeNum();
                                ++v6.likeCount;
                                v6.userLike = true;
                                v5.setUserLike(true);
                                long v8 = NewArticleDetailFragment.this.mNewDetailContext.adId;
                                AbsArticle.a v5_1 = new AbsArticle.a();
                                v0_2 = v6.userLike ? 1 : 0;
                                v5_1.userLike = v0_2;
                                v5_1.likeCount = v6.likeCount;
                                CallbackCenter.notifyCallback(BaseAppData.callbackTypeSpipeItemStateChanged, new Object[]{BaseAppData.callbackTypeSpipeItemStateChanged, Long.valueOf(v6.groupId), v5_1});
                                if (v6 != null) {
                                    NewArticleDetailFragment.this.mArticleActionHelper.a(18, ((AbsArticle) v6), v8);
                                }

                                v4.mNewDetailPageExtra.a();
                                return;
                            }

                            NewArticleDetailFragment.this.showImageToast(0, com.ss.android.article.browser.R.string.ss_hint_digg);
                        }
                    }
                }
            }, new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    NewArticleDetailFragment.this.reportEvent("info_report");
                    if (NewArticleDetailFragment.this.mArticle != null) {
                        if (NewArticleDetailFragment.this.mDetailHelper != null) {
                            NewArticleDetailFragment.this.mDetailHelper.a(
                                    NewArticleDetailFragment.this.mArticle,
                                    NewArticleDetailFragment.this.mNewDetailContext.adId);
                        }
                    }
                }
            });
        }
        this.mNewDetailViewHolder.mNewDetailAdapter.mArticle = this.mArticle;
        if (!android.support.design.a.isTextEmpty(this.mLandingPageUrl) && this.getVideoController() != null) {
            this.getVideoController().showAdGoLanding(this.mLandingPageUrl);
        }

        if (newDetailViewHolder != null) {
            newDetailViewHolder.mNewDetailPageExtra.d();
        }

        if ((this.isNovel()) && !this.hasNovelLastReadPosition) {
            this.scrollWebPageToPosition(articleInfo.articlePosition);
        }
    }

    public final void onArticleDetailLoadedWithCache(Article article, ArticleDetail articleDetail) {
        if (!this.isFinishing()) {
            if (article != null && articleDetail != null && article.groupId == articleDetail.itemId) {
                String content = articleDetail.content;
                String h5Extra = articleDetail.h5Extra;
                if (articleDetail.delete) {
                    ((NewDetailActivity) this.getActivity()).switchToArticleDeleted(article);
                } else if (android.support.design.a.isTextEmpty(content)) {
                    this.maybeScrollToLastReadRecord();
                } else {
                    this.mNewDetailContext.articleDetail = articleDetail;
                    if (mNewDetailViewHolder != null && mArticle != null && mArticle == article) {
                        this.bindContent(mNewDetailViewHolder, content, h5Extra);
                        Logger.d(NewArticleDetailFragment.TAG, "rebind content upon refresh: " + mArticle.groupId);
                        this.isArticleDetailLoading = false;
                        this.setDisableScrollOver(mArticle);
                        this.handleExtraPage();
                    }
                }

                return;
            }

            this.maybeScrollToLastReadRecord();
        }
    }

    public final void onLoaded(Article article, AbsArticle absArticle, ArticleDetail articleDetail) {
    }

    public final void a(IVideoFullscreen videoFullscreen) {
        if (videoFullscreen != null) {
            this.mVideoFullscreenDelegate = videoFullscreen;
        }
    }

    final void reportEvent(String event) {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("item_id", this.mArticle.itemId);
        } catch (JSONException jsonException) {
            jsonException.printStackTrace();
        }

        this.reportEvent(event, jsonObject);
    }

    public final void playNativeVideo(String vid, int arg2, int arg3, int arg4, int status, String callbackId) {
        this.mVid = vid;
        this.an = arg2;
        this.ao = arg3;
        this.ap = arg4;
        this.playVideo(callbackId);
    }

    public final void playVideo(String arg1, int arg2, int arg3, String arg4) {
        this.aq = arg1;
        this.ao = arg2;
        this.ap = arg3;
        this.playVideo(arg4);
    }

    public final void onLoaded(String arg1, long arg2, Response response) {
    }

    public final void onArticleDetailLoadedFromInternet(String arg2, Article article, ArticleDetail articleDetail) {
        if (!this.isFinishing()) {
            this.showContent(articleDetail);
        }
    }

    public final void comment(String userName, String text, long commentId, int arg8) {
        if (this.isActive()) {
            if (mNewDetailViewHolder != null && mArticle != null && !mArticle.mBanComment && this.mSpipe != null && this.mDetailHelper != null) {
                this.aG = arg8;
                this.mDetailHelper.a(Comment.a(this.mSpipe, userName, text), commentId, true);
            }
        }
    }

    final void handleDownload(String url, String arg12, String arg13) {
        String refererUrl = null;
        if (this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mWebView != null) {
            refererUrl = this.mNewDetailViewHolder.mWebView.getUrl();
        }

        JSONObject jsonObject2;
        if (this.mNewDetailContext.adId <= 0L
                && !android.support.design.a.isTextEmpty(refererUrl) && !this.mAppData.j(refererUrl)) {
            jsonObject2 = new JSONObject();
            JSONObject jsonObject = new JSONObject();
            try {
                jsonObject.put("url", url);
                jsonObject.put("referer_url", refererUrl);
                jsonObject2.put("label", "browser");
                jsonObject2.put("ext_json", jsonObject);
            } catch (JSONException v0_1) {
            }

            AppUtil.reportAppDownloadBanned(this.getContext(), jsonObject2);
            return;
        }

        try {
            JSONObject v5 = new JSONObject();
            jsonObject2 = new JSONObject();
            try {
                jsonObject2.put("url", url);
                jsonObject2.put("ad_id", this.mNewDetailContext.adId);
                if (!android.support.design.a.isTextEmpty(refererUrl)) {
                    jsonObject2.put("referer_url", refererUrl);
                }

                if (this.mArticle != null) {
                    jsonObject2.put("group_id", this.mArticle.groupId);
                    jsonObject2.put("item_id", this.mArticle.itemId);
                    jsonObject2.put("aggr_type", this.mArticle.aggrType);
                    if (!android.support.design.a.isTextEmpty(refererUrl) && !MediaAppUtil.a(refererUrl, this.mArticle.articleUrl)) {
                        jsonObject2.put("init_url", this.mArticle.articleUrl);
                    }
                }

                if (this.mNewDetailContext.adId <= 0L) {
                    jsonObject2.put("in_white_list", 1);
                }

                v5.put("label", "browser");
                v5.put("ext_json", jsonObject2);
            } catch (JSONException v0_1) {
            }
            AppUtil.a(this.mContext, this.mAppData, url, arg12, arg13, v5, new long[1]);
        } catch (Exception exception) {
            Logger.w(NewArticleDetailFragment.TAG, "handleDownload exception " + url + " : " + exception);
        }
    }

    public final void shareToWeChat(String arg1, JSONObject arg2) {
    }

    public final void startThumbPreviewActivity(List<ImageInfo> imageInfoList, int selectedIndex) {
        this.I = false;
        ThumbPreviewActivity.startActivity(
                this.getContext(),
                android.support.design.a.imageInfoList2ImageList(imageInfoList),
                selectedIndex);
    }

    final void a(boolean arg7) {
        FragmentActivity v0_2;
        long v0_1;
        String v3;
        if (!this.isFinishing() && (this.au)) {
            if ((arg7) && !this.r) {
                this.r = true;
                if (!this.av) {
                    this.av = true;
                    JSONObject v2 = new JSONObject();
                    try {
                        v2.put("item_id", this.mArticle.itemId);
                        v3 = "media_id";
                        if (this.mNewDetailContext.articleDetail != null) {
                            v0_1 = this.mNewDetailContext.articleDetail.mediaId;
                        } else {
                            v0_1 = 0;
                        }
                        v2.put(v3, v0_1);
                    } catch (JSONException v0) {
                        label_37:
                        v0.printStackTrace();
                    }

                    this.reportEvent("show_titlebar_pgc", v2);
                    v0_2 = ((NewDetailActivity) this.getActivity());
                    if (!((NewDetailActivity) v0_2).j) {
                        return;
                    }

                    ((NewDetailActivity) v0_2).mDetailTitleBar.d();
                    return;
                } else {
                    v0_2 = ((NewDetailActivity) this.getActivity());
                    if (!((NewDetailActivity) v0_2).j) {
                        return;
                    }

                    ((NewDetailActivity) v0_2).mDetailTitleBar.d();
                    return;
                }
            }

            if (arg7) {
                return;
            }

            if (!this.r) {
                return;
            }

            this.r = false;
            v0_2 = ((NewDetailActivity) this.getActivity());
            if (!((NewDetailActivity) v0_2).j) {
                return;
            }
            ((NewDetailActivity) v0_2).mDetailTitleBar.e();
        }
    }

    public final boolean a(CommentWrapper arg2) {
        return this.mCommentList.contains(arg2);
    }

    public final boolean a(Article article) {
        return false;
    }

    public final boolean a(Article article, int arg3) {
        return false;
    }

    private String aa() {
        String v0 = null;
        if (this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mWebView != null) {
            String v1 = this.mNewDetailViewHolder.mWebView.getOriginalUrl();
            if (!android.support.design.a.isTextEmpty(v1) && !v1.equals("about:blank")) {
                v0 = NewArticleDetailFragment.i(v1);
            }
        }

        return v0;
    }

    private int ab() {
        int v0 = 0;
        int v1 = this.getSwipeOverlayHeight();
        int v2 = this.getContentHeight();
        if (v1 != 0 && v2 != 0) {
            int v3 = v2 / v1;
            if (v2 % v1 != 0) {
                v0 = 1;
            }
            v0 += v3;
        }
        return v0;
    }

    final void initDetailTitleBar(Article arg4) {
        if (arg4 != null) {
            Article article = this.mArticle;
            if (article != null) {
                switch (this.getCommentMode()) {
                    case 0: {
                        this.setFavorIconSelected(article.userRepin);
                        break;
                    }
                }

                int commentCount = article.commentCount;
                boolean writeCommentEnable = !article.mBanComment;
                if (this.isFinishing()) {
                    if (this.isFinishing()) {
                        return;
                    }
                    ((NewDetailActivity) this.getActivity()).mDetailTitleBar.setInfoTitle(arg4.title);
                    return;
                } else {
                    ((NewDetailActivity) this.getActivity()).setCommentCount(commentCount);
                    ((NewDetailActivity) this.getActivity()).setWriteCommentEnabled(writeCommentEnable);
                }
            }
            if (this.isFinishing()) {
                return;
            }
            ((NewDetailActivity) this.getActivity()).mDetailTitleBar.setInfoTitle(arg4.title);
        }
    }

    public final void b() {
        int v8 = 8;
        this.mContext = this.getContext();
        this.aO = System.currentTimeMillis();
        this.mAppData = AppData.getInstance();
        if (this.mAppData.aD()) {
            com.bytedance.common.b.g.a();
        }

        CallbackCenter.addCallback(BaseAppData.callbackTypeAddArticleCommentFromUpdate, this.addArticleCommentFromUpdateCallback);
        CallbackCenter.addCallback(BaseAppData.callbackTypeArticleSubOrUnsub, this.articleSubOrUnsubCallback);
        this.mArticleActionHelper = new ArticleActionHelper(this.getContext());
        this.mAllowHtmlVideo = this.mAppData.mAllowHtmlVideo;
        this.mDisableDetailFragmentPreload = this.mAppData.ar() && this.mAppData.getAppSettings().disableDetailFragmentPreload();
        this.mResources = this.mContext.getResources();
        this.mSpipe = Spipe.inst();
        this.mIsNightMode = AppData.isNightMode();
        this.Z = true;
        DBHelper.getInstance(this.getContext());
        this.mNewDetailContext = ((NewDetailActivity) this.getActivity()).getNewDetailContext();
        this.mRecordManager = RecordManager.getInstance();
        this.mDetailHelper = new DetailHelper(this.getActivity(), ItemType.ARTICLE, this.mWeakHandler, this.mArticleActionHelper, "detail");
        this.mDetailHelper.a();
        this.mFromNotification = this.mNewDetailContext.fromNotification;
        this.mFontSizePref = this.mAppData.mFontSizePref;
        this.mContext.getResources().getDisplayMetrics();
        this.mInfoLRUCache = new InfoLRUCache(v8, v8);
        ImageProvider.addOnRemoteImageLoadedListener(((ImageProvider.OnRemoteImageLoadedListener) this));
        this.disableInfoLayer = this.mAppData.mDisableArticleInfoLayer;
        this.mPresenter.mDetailLoadResultHandler.mDetailLoader.useV16 = true;
        this.mPresenter.mDetailLoadResultHandler.mDetailLoader.article_page = 0;
        this.maybeReplaceUserAgent(this.mArticle);
    }

    public final void onGetSeriesLinkPosition(int arg3) {
        this.A = ((int) ((((float) arg3)) * UserAgentCompat.getScale(this.mNewDetailViewHolder.mWebView)));
    }

    public final void onPageStarted(WebView webView) {
        if (Build.VERSION.SDK_INT != 19
                && !this.mAppData.getAppSettings().disableDetailWebViewAnimation()
                && this.mWebContainerAnimState == 0
                && this.mWebContainer != null) {
            this.mWebContainer.setAlpha(0f);
            Animator animator = AccountAnimatorHelper.createFadeInAnimation(this.mWebContainer, new AnimatorListenerAdapter() {
                public final void onAnimationEnd(Animator anim) {
                    super.onAnimationEnd(anim);
                    NewArticleDetailFragment.this.mWebContainerAnimState = 2;
                }

                public final void onAnimationStart(Animator anim) {
                    super.onAnimationStart(anim);
                    NewArticleDetailFragment.this.mWebContainerAnimState = 1;
                }
            });
            animator.setInterpolator(new LinearInterpolator());
            animator.setStartDelay(400);
            animator.setDuration(100);
            animator.start();
        }

        if (this.U) {
            webView.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    if (!NewArticleDetailFragment.this.isFinishing()) {
                        NewArticleDetailFragment.this.hideProgressBar();
                        NewArticleDetailFragment.this.mRootView.setVisibility(View.VISIBLE);
                        ((NewDetailActivity) NewArticleDetailFragment.this.getActivity()).inflatDetailErrorView().hideSelf();
                    }
                }
            }, 5000);
        }
    }

    public final void b(Comment comment) {
        if ((this.isViewValid())
                && comment != null
                && this.mNewDetailViewHolder != null
                && this.mArticle != null
                && comment != null
                && this.mArticle.groupId == comment.groupId) {
            MobClickCombiner.onEvent(this.getContext(), "comment", "click_comment");
            MobClickCombiner.onEvent(this.getContext(), "comment", "repost_menu");
            if (this.mDetailHelper != null) {
                this.mDetailHelper.b();
                this.mDetailHelper.a(comment);
                this.aG = 0;
            }
        }
    }

    public final void addComment(CommentWrapper arg2) {
        this.mCommentList.add(arg2);
    }

    public final void setFavorIconSelected(boolean favorIconSelected) {
        if (!this.isFinishing()) {
            ((NewDetailActivity) this.getActivity()).setFavorIconSelected(favorIconSelected);
        }
    }

    final void onEvent2(String event) {
        if (this.mArticle != null && this.mNewDetailContext.articleDetail != null) {
            JSONObject jsonObject = new JSONObject();
            try {
                jsonObject.put("item_id", this.mArticle.itemId);
            } catch (Exception exception) {
                exception.printStackTrace();
            }

            MobClickCombiner.onEvent(this.mContext, "detail", event, this.mNewDetailContext.articleDetail.mediaId, 0, jsonObject);
        }
    }

    public final void shareToQQ(String arg1, JSONObject arg2) {
    }

    private void c(Article arg11) {
        int v9;
        int v0_1;
        if (arg11 != null) {
            Object v1 = null;
            Iterator v3 = this.aT.values().iterator();
            while (v3.hasNext()) {
                Object v0 = v3.next();
                if (((NewArticleDetailFragment$a) v0).e == 0) {
                    v1 = v0;
                }

                if (!Logger.debug()) {
                    continue;
                }

                Logger.v(NewArticleDetailFragment.TAG, "== " + ((NewArticleDetailFragment$a) v0).e + " "
                        + ((NewArticleDetailFragment$a) v0).url + " "
                        + ((NewArticleDetailFragment$a) v0).precentage + " "
                        + ((NewArticleDetailFragment$a) v0).screencount);
            }

            if (v1 == null || ((NewArticleDetailFragment$a) v1).url == null) {
                v0_1 = 0;
                v9 = 0;
            } else {
                if (!((NewArticleDetailFragment$a) v1).url.startsWith("file:///android_asset/article/") && !MediaAppUtil.a(((NewArticleDetailFragment$a) v1).url, arg11.articleUrl)) {
                    v0_1 = 0;
                    v9 = 0;
                } else {
                    int v2 = Math.round(((NewArticleDetailFragment$a) v1).precentage * 100f);
                    v0_1 = ((NewArticleDetailFragment$a) v1).screencount;
                    v9 = v2;
                }
            }

            String v3_1 = this.getEnterFrom();
            if (AppData.getInstance().getAbSettings().isAppLogOld()) {
                JSONObject v8 = new JSONObject();
                try {
                    v8.put("pct", v9);
                    v8.put("page_count", v0_1);
                    v8.put("item_id", arg11.itemId);
                    v8.put("aggr_type", arg11.aggrType);
                } catch (JSONException v1_1) {
                    v1_1.printStackTrace();
                }

                this.getContext();
                AppLog.onEvent("article", "read_pct", v3_1, arg11.groupId, this.mNewDetailContext.adId, v8);
            }

            if (!AppData.getInstance().getAbSettings().isAppLogNew()) {
                return;
            }

            JSONObject v7 = new JSONObject();
            try {
                v7.put("ad_id", this.mNewDetailContext.adId);
                v7.put("page_count", v0_1);
                v7.put("percent", v9);
            } catch (JSONException v0_2) {
            }

            this.reportArticleSubOrUnsub("read_pct", v7, new BaseArticle(arg11.groupId, arg11.itemId, arg11.aggrType));
        }
    }

    final void doPlayVideo(String callbackId) {
        IVideoController videoController = this.getVideoController();
        if (videoController != null) {
            if (mArticle == null) {
                return;
            }

            JSONObject jsonObject = new JSONObject();
            try {
                jsonObject.put("log_pb", this.mNewDetailContext.logPb);
                jsonObject.put("search_result_id", this.mNewDetailContext.searchResultId);
                jsonObject.put("source", this.mNewDetailContext.source);
                jsonObject.put("query", this.mNewDetailContext.query);
            } catch (JSONException jsonException) {
            }

            boolean playResult = videoController.play(this.aq,
                    this.mCategoryName,
                    mArticle.title,
                    this.mNewDetailContext.adId,
                    mArticle,
                    this.mVid,
                    this.an,
                    this.ao,
                    this.ap,
                    mArticle.adVideoClickTrackUrls,
                    this.aQ, this.getEnterFrom(),
                    false,
                    this.mLandingPageUrl,
                    this.mLogExtra,
                    jsonObject);
            videoController.setPlayCompleteListener(this.mPlayCompleteListener);
            if (this.aQ > 0) {
                this.aQ = -1;
            }

            int titleBarHeight = this.getDetailTitleBarHeight();
            if ((playResult) && !android.support.design.a.isTextEmpty(callbackId)) {
                JSONObject v6;
                NewArticleDetailTTAndroidObject v3_3;
                int v2_1;
                String v5;
                Presenter v3_2;
                if (android.support.design.a.isTextEmpty(this.aq)) {
                    v3_2 = this.mPresenter;
                    v5 = this.mVid;
                    v2_1 = UIUtils.px2dp(this.mContext, ((float) videoController.getContainerHeight()));
                    v3_3 = ((ArticleDetailCommentPresenter) v3_2).mDetailWebInteractor.mNewArticleDetailTTAndroidObject;
                    if (v2_1 <= 0) {
                    } else {

                        if (android.support.design.a.isTextEmpty(callbackId)) {
                        } else {
                            try {
                                v6 = new JSONObject();
                                v6.put("code", 1);
                                v6.put("height", v2_1);
                                v6.put("vid", v5);
                                v3_3.sendCallbackMsg(callbackId, v6);
                            } catch (Exception v2_2) {
                            }
                        }
                    }
                } else {
                    v3_2 = this.mPresenter;
                    v5 = this.aq;
                    v2_1 = UIUtils.px2dp(this.mContext, ((float) videoController.getContainerHeight()));
                    v3_3 = ((ArticleDetailCommentPresenter) v3_2).mDetailWebInteractor.mNewArticleDetailTTAndroidObject;
                    if (v2_1 > 0 && !android.support.design.a.isTextEmpty(callbackId)) {
                        try {
                            v6 = new JSONObject();
                            v6.put("code", 1);
                            v6.put("height", v2_1);
                            v6.put("url", v5);
                            v3_3.sendCallbackMsg(callbackId, v6);
                        } catch (Exception v2_2) {
                        }
                    }
                }
            }
            if (this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mWebView != null) {
                this.mNewDetailViewHolder.mWebView.getLayoutParams().height = this.mNewDetailViewHolder.mWebView.getLayoutParams().height + titleBarHeight;
                this.mNewDetailViewHolder.mWebView.requestLayout();
            }

            if (!this.isFinishing()) {
                ((NewDetailActivity) this.getActivity()).setDetailTitleBarVisible(false);
            }
        }
    }

    final void checkAndShowCommentShow(NewDetailViewHolder newDetailViewHolder) {
        if (newDetailViewHolder != null
                && newDetailViewHolder.mDetailScrollView != null
                && newDetailViewHolder.mNewDetailPageExtra != null
                && !newDetailViewHolder.isDetailCommentsShowReported) {
            Article v1 = this.mArticle;
            if (v1 != null) {
                int[] v2 = new int[2];
                newDetailViewHolder.mDetailScrollView.getLocationInWindow(v2);
                int v3 = newDetailViewHolder.mDetailScrollView.getHeight() + v2[1];
                int v0 = 2147483647;
                v2[1] = v0;
                if (newDetailViewHolder.mNewDetailPageExtra.mContentsWrapper != null && (newDetailViewHolder.mNewDetailPageExtra.mContentsWrapper.isShown())) {
                    newDetailViewHolder.mNewDetailPageExtra.mContentsWrapper.getLocationInWindow(v2);
                    v0 = v2[1] + newDetailViewHolder.mNewDetailPageExtra.mContentsWrapper.getHeight();
                }

                if (v0 >= v3) {
                    return;
                }

                newDetailViewHolder.isDetailCommentsShowReported = true;
                this.reportEvent("enter_comment", v1, this.mNewDetailContext.adId);
                if (!this.mAppData.loginCommentFirst) {
                    Context context = this.mContext;
                    if (!this.mSpipe.isLogin && (this.mAppData.l())) {
                        View.OnClickListener commentOnClickListener = new View.OnClickListener() {
                            @Override
                            public final void onClick(View arg2) {
                                NewArticleDetailFragment.this.mAppData.k();
                                NewArticleDetailFragment.this.r();
                            }
                        };
                        if (this.isViewValid()) {
                            com.ss.android.article.base.feature.app.bb v2_1 = new com.ss.android.article.base.feature.app.bb(context, "login_detail_comment");
                            v2_1.a(0, com.ss.android.article.browser.R.string.rv, com.ss.android.article.browser.R.string.rt);
                            v2_1.a(com.ss.android.article.browser.R.string.rs, commentOnClickListener);
                            v2_1.show();
                        }

                        this.mAppData.a(System.currentTimeMillis());
                        this.mAppData.m();
                    }
                }
                this.isDetailCommentsShowReported = true;
            }
        }
    }

    public final void c() {
        int v4 = com.ss.android.article.browser.R.color.ssxinmian4;
        if (this.mAppData.getAbSettings().isNormalShare()) {
            ((NewDetailActivity) this.getActivity()).hideMoreBtn();
        }

        this.mSwipeOverlayFrameLayout.setVisibility(View.VISIBLE);
        this.mDiggAnimationView = com.ss.android.article.base.ui.DiggAnimationView.a(this.mRootView);
        com.ss.android.article.base.feature.detail2.config.a.a(this.mRootView, this.mResources.getColor(v4));
        this.mNewDetailViewHolder.mWebView.setBackgroundColor(this.mResources.getColor(v4));
        if (android.support.design.a.i()) {
            FragmentActivity fragmentActivity = this.getActivity();
            MuteQuickClickListener searchClickListener = new MuteQuickClickListener() {
                public final void doOnClick(View view) {
                    if (!NewArticleDetailFragment.this.isFinishing()) {
                        Intent intent = new Intent();
                        intent.setClassName(NewArticleDetailFragment.this.getActivity(), "com.ss.android.article.base.feature.search.SearchActivity");
                        intent.putExtra("from", "detail");
                        intent.putExtra("delay_override_activity_trans", true);
                        NewArticleDetailFragment.this.startActivity(intent);
                        NewArticleDetailFragment.this.getActivity().overridePendingTransition(com.ss.android.article.browser.R.anim.z, com.ss.android.article.browser.R.anim.a0);
                        ((NewDetailActivity) NewArticleDetailFragment.this.getActivity()).mDetailTitleBar.g = true;
                        MobClickCombiner.onEvent(NewArticleDetailFragment.this.mContext, "search", "detail_icon_article");
                    }
                }
            };
            ((NewDetailActivity) fragmentActivity).mDetailTitleBar.setSearchIconVisibility(0);
            ((NewDetailActivity) fragmentActivity).mDetailTitleBar.setSearchClickListener(searchClickListener);
        }

        boolean hardwareAccelerate = Build.VERSION.SDK_INT >= 16 && (!this.mNewDetailContext.bundleNoHwAcceleration);
        SSWebSettings webSettings = SSWebSettings.createWebSettings(this.getContext());
        webSettings.hardwareAccelerate = hardwareAccelerate;
        webSettings.setJavaScriptEnabled(this.mNewDetailViewHolder.mWebView);
        this.mNewDetailViewHolder.mWebView.setWebViewClient(this.mPresenter.mDetailWebInteractor.mMyWebViewClient);
        this.mNewDetailViewHolder.mWebView.setWebChromeClient(this.mPresenter.mDetailWebInteractor.mDetailWebChromeClient);
        String userAgentString = this.mNewDetailViewHolder.mWebView.getSettings().getUserAgentString();
        if (!android.support.design.a.isTextEmpty(userAgentString)) {
            AppLog.f(userAgentString);
        }

        this.mCustomUserAgent = this.mAppData.a(this.getContext(), this.mNewDetailViewHolder.mWebView);
        this.mOriginUserAgent = AppUtil.getUserAgent(this.getContext(), this.mNewDetailViewHolder.mWebView);
        this.setUserAgent(this.mArticle, this.mNewDetailViewHolder.mWebView);
        this.mNewDetailViewHolder.mDetailScrollView.setDisableInfoLayer(this.disableInfoLayer);
        this.findView(com.ss.android.article.browser.R.id.detail_page).setTag(this.mNewDetailViewHolder);
        WebViewTweaker.tryTweakWebCoreHandler(this.mAppData.mHackWebCoreHandler, this.mAppData.mHackWebCoreHandlerZTE, this.mAppData.mHackWebCoreHandlerAll);
        if (mNewDetailViewHolder != null) {
            if (mNewDetailViewHolder.mNewDetailAdapter != null) {
                mNewDetailViewHolder.mNewDetailAdapter.onPause();
                mNewDetailViewHolder.mNewDetailAdapter.onDestroy();
            }

            mNewDetailViewHolder.mNewDetailAdapter = new NewDetailAdapter(this.mContext, ((Fragment) this), this.mDiggAnimationView);
            mNewDetailViewHolder.mNewDetailAdapter.mArticle = this.mArticle;
            mNewDetailViewHolder.mNewDetailAdapter.a(mNewDetailViewHolder.mListView);
            mNewDetailViewHolder.mNewDetailAdapter.j = this;
            mNewDetailViewHolder.mNewDetailAdapter.i = true;
            mNewDetailViewHolder.mNewDetailAdapter.mAdId = this.mNewDetailContext.adId;
            mNewDetailViewHolder.mListView.setAdapter(mNewDetailViewHolder.mNewDetailAdapter);
            mNewDetailViewHolder.mListView.setRecyclerListener(mNewDetailViewHolder.mNewDetailAdapter);
        }

        if (this.mDisableDetailFragmentPreload) {
            this.mWebContainer.removeView(this.mNewDetailViewHolder.mDetailScrollView);
        }
    }

    public final void onSharePlatformClick(int arg1) {
    }

    public final void deleteComment(final Comment comment) {
        if (comment != null && (UpdateItemMgr.getInstance(this.getContext()).checkLoginAndNet(comment.userId))) {
            UpdateItemMgr.showDeleteConfirmDialog(this.getContext(), new DialogInterface.OnClickListener() {
                @Override
                public final void onClick(DialogInterface arg7, int arg8) {
                    if (comment != null) {
                        NewDetailViewHolder newDetailViewHolder = NewArticleDetailFragment.this.mNewDetailViewHolder;
                        if (newDetailViewHolder != null && newDetailViewHolder.mCommentTabCache != null) {
                            if (newDetailViewHolder.mCommentTabCache.removeCommnet(comment.commentId)) {
                                newDetailViewHolder.mNewDetailAdapter.addAllComment(newDetailViewHolder.mCommentTabCache.mArticleTabComments[0].commentWrapperList);
                                newDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                                --NewArticleDetailFragment.this.mArticle.commentCount;
                                NewArticleDetailFragment.this.initDetailTitleBar(NewArticleDetailFragment.this.mArticle);
                                NewArticleDetailFragment.this.showCommentListOrSofa(NewArticleDetailFragment.this.mNewDetailViewHolder, NewArticleDetailFragment.this.mNewDetailViewHolder.mCommentTabCache);
                            }
                            UpdateItemMgr.getInstance(NewArticleDetailFragment.this.getContext()).deleteComment(comment.commentId);
                        }
                    }
                }
            });
        }
    }

    public final void shareToMoment(String arg1, JSONObject arg2) {
    }

    public final void showTitleBarPgcLayout(boolean arg2) {
        if (!this.isTitleBarPgcLayoutShow) {
            this.isTitleBarPgcLayoutShow = true;
        }
        this.a(arg2);
    }

    private void d(Article article) {
        if (article != null) {
            article.clickTimestamp = System.currentTimeMillis();
            DBHelper dbHelper = DBHelper.getInstance(this.mContext);
            if (dbHelper != null) {
                dbHelper.syncReadTs(article);
                if (ArticleHelper.b >= 0 && article != null && this.mAppData != null) {
                    FeedTab v0_1 = this.mAppData.t();
                    if (v0_1 != null) {
                        ArrayList v1 = new ArrayList();
                        v0_1.getCurrentList(-1, ((List) v1));
                        if (((List) v1).size() > ArticleHelper.b) {
                            Object v0_2 = ((List) v1).get(ArticleHelper.b);
                            if (v0_2 != null && ((CellRef) v0_2).ac != null && ((CellRef) v0_2).ac.size() != 0) {
                                int v2 = 0;
                                while (v2 < ((CellRef) v0_2).ac.size()) {
                                    Object v1_1 = ((CellRef) v0_2).ac.get(v2);
                                    if (((CellRef) v1_1).article.groupId == article.groupId) {
                                        ((CellRef) v1_1).article.clickTimestamp = System.currentTimeMillis();
                                        ArticleHelper.a(this.getContext(), ((CellRef) v0_2), v2);
                                    } else {
                                        ++v2;
                                        continue;
                                    }

                                    return;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    private View findView(int resId) {
        return this.mRootView.findViewById(resId);
    }

    private void reportEvent(String arg10, JSONObject arg11) {
        MobClickCombiner.onEvent(this.mContext, "detail", arg10, this.mArticle.groupId, this.mNewDetailContext.adId, arg11);
    }

    final void checkAndReportDetailAdShow(NewDetailViewHolder newDetailViewHolder) {
        if (newDetailViewHolder != null
                && !newDetailViewHolder.isDetailAdShowReported
                && newDetailViewHolder.mNewDetailPageExtra != null
                && newDetailViewHolder.mNewDetailPageExtra.mDetailAdContainer != null
                && newDetailViewHolder.mNewDetailPageExtra.mDetailAdContainer.getVisibility() == View.VISIBLE
                && newDetailViewHolder.mNewDetailPageExtra.mArticleInfo != null
                && (newDetailViewHolder.mNewDetailPageExtra.b())) {
            int[] location = new int[2];
            newDetailViewHolder.mDetailScrollView.getLocationOnScreen(location);
            int v1 = location[1] + newDetailViewHolder.mDetailScrollView.getHeight();
            newDetailViewHolder.mNewDetailPageExtra.mDetailAdContainer.getLocationOnScreen(location);
            if (location[1] < 0) {
                return;
            }

            if (location[1] > v1) {
                return;
            }

            this.trackAdShow(newDetailViewHolder.mNewDetailPageExtra.mArticleInfo.mBannerAdsData);
            this.trackAdShow(newDetailViewHolder.mNewDetailPageExtra.mArticleInfo.A);
            this.trackAdShow(newDetailViewHolder.mNewDetailPageExtra.mArticleInfo.B);
            DownloadAppAd downloadAppAd = newDetailViewHolder.mNewDetailPageExtra.mArticleInfo.mDownloadAppAd;
            if (downloadAppAd != null
                    && downloadAppAd.isValid()
                    && !ToolUtils.isAppInstalled(this.mContext, downloadAppAd.pkg)
                    && (downloadAppAd.K)) {
                BaseAdsData.trackAdShow(this.mContext, "detail_ad", downloadAppAd, 1);
            }

            PhoneAdsData v0_2 = newDetailViewHolder.mNewDetailPageExtra.mArticleInfo.z;
            if (v0_2 != null && (v0_2.isValid()) && (v0_2.K)) {
                BaseAdsData.trackAdShow(this.mContext, "detail_call", v0_2, 1);
            }

            this.trackAdShow(newDetailViewHolder.mNewDetailPageExtra.mArticleInfo.y);
            ArticleInfo articleInfo = newDetailViewHolder.mNewDetailPageExtra.mArticleInfo;
            if (articleInfo != null && articleInfo.E != null && (articleInfo.E.isValid())) {
                JSONObject jsonObject = null;
                try {
                    jsonObject = new JSONObject();
                    jsonObject.put("log_extra", articleInfo.E.logExtra);
                    jsonObject.put("item_id", articleInfo.groupItemId);
                    if (articleInfo.mMediaInfo != null) {
                        jsonObject.put("media_id", articleInfo.mMediaInfo.id);
                    }
                } catch (JSONException jsonException) {
                    jsonException.printStackTrace();
                }
                MobAdClickCombiner.onAdEvent(this.mContext, "detail_ad", "show", articleInfo.E.id, 0, jsonObject, 1);
            }
            newDetailViewHolder.isDetailAdShowReported = true;
        }
    }

    public final void d() {
        this.mFullscreenVideoFrame.setListener(new FullscreenVideoFrame.OnHideFullscreenVideoFrameListener() {
            @Override
            public final void onHideFullscreenVideoFrame() {
                NewArticleDetailFragment.this.client_onHideCustomView();
            }
        });
        this.mSwipeOverlayFrameLayout.setOnSwipeListener(new SwipeOverlayFrameLayout.OnSwipeBackListener() {
            @Override
            public final boolean onSwipeBack() {
                NewArticleDetailFragment.this.isUserSwipeBack = true;
                NewArticleDetailFragment.this.finishPage();
                return true;
            }

            public final boolean b() {
                return false;
            }
        });
        this.mNewDetailViewHolder.mWebView.setDownloadListener(new DownloadListener() {
            @Override
            public final void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
                NewArticleDetailFragment.this.handleDownload(url, userAgent, mimetype);
            }
        });
        this.mNewDetailViewHolder.mWebView.setOnScrollChangeListener(new com.ss.android.article.base.ui.ScrollListenerWebView.OnScrollChangeListener() {
            @Override
            public final void onScrollChanged(int scrollY) {
                if (!NewArticleDetailFragment.this.isFinishing()) {
                    NewArticleDetailFragment.this.articlePosition = scrollY;
                }

                NewArticleDetailFragment.this.f("");
                ImpressionListAdapter v1 = NewArticleDetailFragment.this.mImpressionListAdapter;
                if (v1 != null) {
                    int v0_1 = NewArticleDetailFragment.this.getSwipeOverlayHeight();
                    if (v0_1 > 0) {
                        v1.onMovedToScrapHeap(scrollY / v0_1);
                    }
                }

                if (NewArticleDetailFragment.this.mNewDetailViewHolder != null && NewArticleDetailFragment.this.mNewDetailViewHolder.mWebView != null) {
                    com.ss.android.article.base.feature.detail2.article.NewArticleDetailFragment.NewArticleDetailFragment$a v0_2 = NewArticleDetailFragment.this.J();
                    if (v0_2 != null) {
                        v0_2.maxscrollheight = Math.max(v0_2.maxscrollheight, scrollY);
                    }
                }
            }
        });
        this.mNewDetailViewHolder.mNewDetailPageExtra.mSofaLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View arg2) {
                NewArticleDetailFragment.this.r();
            }
        });
        this.mNewDetailViewHolder.mListView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public final void onGlobalLayout() {
                int v2 = 2;
                if (NewArticleDetailFragment.this.mNewDetailViewHolder != null && NewArticleDetailFragment.this.mNewDetailViewHolder.mListView != null) {
                    if (NewArticleDetailFragment.this.E == null) {
                        NewArticleDetailFragment.this.E = new int[v2];
                    }

                    int[] location = new int[2];
                    NewArticleDetailFragment.this.mNewDetailViewHolder.mDetailScrollView.getLocationInWindow(location);
                    NewArticleDetailFragment.this.E[0] = location[1];
                    NewArticleDetailFragment.this.E[1] = location[1] + NewArticleDetailFragment.this.mNewDetailViewHolder.mDetailScrollView.getHeight();
                    if (NewArticleDetailFragment.this.E[0] >= NewArticleDetailFragment.this.E[1]) {
                        return;
                    }

                    NewArticleDetailFragment.this.mNewDetailViewHolder.mListView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                }
            }
        });
        this.mNewDetailViewHolder.mListView.setOnScrollListener(new AbsListView.OnScrollListener() {
            public final void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
                int v6 = 2;
                int v2 = 0;
                NewDetailViewHolder mNewDetailViewHolder = NewArticleDetailFragment.this.mNewDetailViewHolder;
                if (mNewDetailViewHolder != null) {
                    NewArticleDetailFragment.this.checkAndReportConcernWordsShow(mNewDetailViewHolder);
                    NewArticleDetailFragment.this.checkAndReportLikeAndRewardsShow(mNewDetailViewHolder);
                    NewArticleDetailFragment.this.checkAndReportDetailAdShow(mNewDetailViewHolder);
                    NewArticleDetailFragment.this.checkAndShowCommentShow(mNewDetailViewHolder);
                    NewArticleDetailFragment.this.checkAndReportRelatedArticleShow(mNewDetailViewHolder);
                    if (mNewDetailViewHolder.mNewDetailPageExtra != null) {
                        mNewDetailViewHolder.mNewDetailPageExtra.a(NewArticleDetailFragment.this.E);
                    }

                    int v4 = firstVisibleItem + visibleItemCount;
                    NewArticleDetailFragment newArticleDetailFragment = NewArticleDetailFragment.this;
                    newArticleDetailFragment.o = v4 > ((ListView) absListView).getHeaderViewsCount()
                            && mNewDetailViewHolder.mDetailScrollView.getScrollY() > 0;
                    if (!NewArticleDetailFragment.this.p && (NewArticleDetailFragment.this.o)) {
                        mNewDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                        NewArticleDetailFragment.this.p = true;
                    }

                    if ((NewArticleDetailFragment.this.t) && firstVisibleItem == 0 && absListView.getChildCount() > 0) {
                        View v0_1 = absListView.getChildAt(0);
                        int[] v5_1 = new int[v6];
                        int[] v6_1 = new int[v6];
                        v0_1.getLocationInWindow(v5_1);
                        mNewDetailViewHolder.mDetailScrollView.getLocationInWindow(v6_1);
                        if (v5_1[1] > v6_1[1] - AutoUtils.scaleValue(44)) {
                            NewArticleDetailFragment.this.t = false;
                            NewArticleDetailFragment.this.mNewDetailViewHolder.mDetailScrollView.webViewScrollTo(true);
                        }
                    }

                    if (v4 < totalItemCount) {
                        return;
                    }

                    if (((absListView instanceof ListView)) && totalItemCount <= ((ListView) absListView).getHeaderViewsCount() + ((ListView) absListView).getFooterViewsCount()) {
                        return;
                    }

                    if (!NetworkUtils.isNetworkAvailable(NewArticleDetailFragment.this.mContext)) {
                        return;
                    }

                    NewArticleDetailFragment articleDetailFragment = NewArticleDetailFragment.this;
                    if (mNewDetailViewHolder == null || mNewDetailViewHolder.mCommentTabCache == null || (articleDetailFragment.p()) || (mNewDetailViewHolder.mCommentTabCache.load[0]) || !mNewDetailViewHolder.mCommentTabCache.mArticleTabComments[0].hasMore) {
                        v2 = -1;
                    }

                    if (v2 < 0) {
                        return;
                    }

                    NewArticleDetailFragment.this.enterComment();
                }
            }

            public final void onScrollStateChanged(AbsListView absListView, int scrollState) {
                NewDetailViewHolder newDetailViewHolder = NewArticleDetailFragment.this.mNewDetailViewHolder;
                if (newDetailViewHolder != null) {
                    if (!newDetailViewHolder.mNewDetailAdapter.h) {
                        newDetailViewHolder.mNewDetailAdapter.h = true;
                    }

                    if (scrollState == 0) {
                        return;
                    }

                    if (NewArticleDetailFragment.this.DetailArticleCommentMonitorFPS == null) {
                        return;
                    }

                    NewArticleDetailFragment.this.DetailArticleCommentMonitorFPS.b();
                }
            }
        });
        this.mNewDetailViewHolder.mDetailScrollView.setMyOnChangedListener(new DetailScrollView.MyOnChangedListener() {
            public final void a() {
                NewArticleDetailFragment.b(NewArticleDetailFragment.this.mNewDetailViewHolder);
            }

            public final void onScrollChanged(int l) {
                int v1 = 340;
                if (!NewArticleDetailFragment.this.isTitleBarPgcLayoutShow) {
                    if (l >= v1 && !NewArticleDetailFragment.this.r) {
                        NewArticleDetailFragment.this.a(true);
                    } else if (l >= v1) {
                    } else if (!NewArticleDetailFragment.this.r) {
                    } else {
                        NewArticleDetailFragment.this.a(false);
                    }
                }
                if (NewArticleDetailFragment.this.mSerialCatalogView != null && NewArticleDetailFragment.this.A > 0) {
                    if (l >= NewArticleDetailFragment.this.mRootView.getHeight() - NewArticleDetailFragment.this.A && !NewArticleDetailFragment.this.z) {
                        NewArticleDetailFragment.this.z = true;
                        AnimatorUtil.animateTopSlideIn(NewArticleDetailFragment.this.mSerialCatalogView);
                    } else if (l >= NewArticleDetailFragment.this.mRootView.getHeight() - NewArticleDetailFragment.this.A) {
                    } else if (!NewArticleDetailFragment.this.z) {
                    } else {
                        NewArticleDetailFragment.this.z = false;
                        AnimatorUtil.animateTopSlideOut(NewArticleDetailFragment.this.mSerialCatalogView);
                    }
                }
                if (!NewArticleDetailFragment.this.t && l >= NewArticleDetailFragment.this.mRootView.getHeight()) {
                    NewArticleDetailFragment.this.t = true;
                }

                NewArticleDetailFragment.this.a(NewArticleDetailFragment.this.mNewDetailViewHolder);
                if (NewArticleDetailFragment.this.mDetailArticleMonitorFPS != null) {
                    NewArticleDetailFragment.this.mDetailArticleMonitorFPS.b();
                }
            }

            public final void setInfoTitleBarVisibility(boolean visible2) {
                if (mArticle != null && !NewArticleDetailFragment.this.isFinishing()) {
                    FragmentActivity fragmentActivity = NewArticleDetailFragment.this.getActivity();
                    boolean visible = mArticle.disableScrollOver() && visible2;
                    ((NewDetailActivity) fragmentActivity).mDetailTitleBar.setInfoTitleBarVisibility(visible);
                }
            }
        });
    }

    public final void d(String arg5) {
        this.u = true;
        if (!android.support.design.a.isTextEmpty(this.f(arg5))
                && this.mImpressionListAdapter != null
                && (this.mImpressionListAdapter.c.isEmpty())) {
            this.mWeakHandler.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    NewArticleDetailFragment.this.f("");
                }
            }, 1000L);
        }

        if (Build.VERSION.SDK_INT != 19
                && !this.mAppData.getAppSettings().disableDetailWebViewAnimation()
                && this.mWebContainerAnimState == 0
                && this.mWebContainer != null) {
            AccountAnimatorHelper.clearAnimation(this.mWebContainer);
            Animator animator = AccountAnimatorHelper.createFadeInAnimation(this.mWebContainer, new AnimatorListenerAdapter() {
                public final void onAnimationEnd(Animator anim) {
                    super.onAnimationEnd(anim);
                    NewArticleDetailFragment.this.mWebContainerAnimState = 2;
                }

                public final void onAnimationStart(Animator animator) {
                    super.onAnimationStart(animator);
                    NewArticleDetailFragment.this.mWebContainerAnimState = 1;
                }
            });
            animator.setInterpolator(new LinearInterpolator());
            animator.setStartDelay(200);
            animator.setDuration(100);
            animator.start();
        }

        if (!this.isArticleDetailLoading) {
            this.maybeScrollToLastReadRecord();
        }
    }

    private void scrollWebPageToPosition(int position) {
        if ((this.mAppData.getAbSettings().isEnableArticleRecord())
                && !this.isFinishing()
                && System.currentTimeMillis() - this.aO <= 1000
                && this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mWebView != null
                && !this.mNewDetailContext.s && this.mNewDetailViewHolder.mWebView.getScrollY() == 0
                && position > 0) {
            if (this.mScrollWebViewAnimator == null) {
                this.mScrollWebViewAnimator = new ValueAnimator();
                this.mScrollWebViewAnimator.setInterpolator(new DecelerateInterpolator());
                this.mScrollWebViewAnimator.setDuration(500);
                this.mScrollWebViewAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                        NewArticleDetailFragment.this.mNewDetailViewHolder.mWebView.scrollTo(0, ((Integer) valueAnimator.getAnimatedValue()).intValue());
                    }
                });
            }

            this.mScrollWebViewAnimator.setIntValues(new int[]{Math.max(0, position - (int) UIUtils.dp2px(this.mContext, 40f)), position});
            this.mScrollWebViewAnimator.start();
        }
    }

    public final void e(String url) {
        String v1 = NewArticleDetailFragment.i(url);
        if (v1 != null) {
            String v2 = this.f(v1);
            if (!android.support.design.a.isTextEmpty(v2) && !this.mImpressionListAdapterItemMap.isEmpty()) {
                Iterator<Map.Entry<String, ImpressionListAdapterItem>> iterator = this.mImpressionListAdapterItemMap.entrySet().iterator();
                while (iterator.hasNext()) {
                    Map.Entry<String, ImpressionListAdapterItem> entry = iterator.next();
                    if (!v2.equals(entry.getKey())) {
                        continue;
                    }

                    ImpressionListAdapterItem item = entry.getValue();
                    if (item == null) {
                        continue;
                    }

                    if (item.index < 0) {
                        continue;
                    }

                    if (item.impressionListAdapter != null) {
                        item.impressionListAdapter.onPause();
                    }
                }
            }

            if (this.mImpressionListAdapter != null) {
                this.mImpressionListAdapter.onResume();
            }

            NewArticleDetailFragment$a v0 = this.aT.get(v1);
            if (v0 != null) {
                v0.maxscrollheight = 0;
                return;
            }

            NewArticleDetailFragment$a v0_2 = new NewArticleDetailFragment$a();
            v0_2.url = v1;
            v0_2.e = this.aT.size();
            this.aT.put(v1, v0_2);
        }
    }

    private void setDisableScrollOver(Article article) {
        if (this.mNewDetailViewHolder != null) {
            DetailScrollView detailScrollView = this.mNewDetailViewHolder.mDetailScrollView;
            boolean disableScrollOver = article != null && article.disableScrollOver();
            detailScrollView.setDisableScrollOver(disableScrollOver);
        }
    }

    final void checkAndReportConcernWordsShow(NewDetailViewHolder newDetailViewHolder) {
        if (newDetailViewHolder != null
                && !newDetailViewHolder.isConcernWordsShowReported
                && newDetailViewHolder.mNewDetailPageExtra != null
                && newDetailViewHolder.mNewDetailPageExtra.mTagLayout != null
                && newDetailViewHolder.mNewDetailPageExtra.mArticleInfo != null) {
            int[] location = new int[2];
            newDetailViewHolder.mDetailScrollView.getLocationOnScreen(location);
            int v1 = location[1] + newDetailViewHolder.mDetailScrollView.getHeight();
            newDetailViewHolder.mNewDetailPageExtra.mTagLayout.getLocationOnScreen(location);
            if (location[1] >= 0 && location[1] < v1) {
                newDetailViewHolder.isConcernWordsShowReported = true;
                this.reportEvent("concern_words_show");
            }
        }
    }

    private void showLoadingProgress(int progress) {
        this.mProgressBar.setProgress(progress);
        this.mWeakHandler.removeMessages(14);
        try {
            if (this.mProgressBar.getVisibility() == View.VISIBLE) {
                return;
            }

            Animation animation = AnimationUtils.loadAnimation(this.mContext, android.R.anim.fade_in);
            if (animation == null) {
                return;
            }

            this.mProgressBar.startAnimation(animation);
            this.mProgressBar.setVisibility(View.VISIBLE);
        } catch (Throwable throwable) {
        }
    }

    private void maybeReplaceUserAgent(Article article) {
        if (article != null && (article.hasArticleUrl())) {
            this.mPresenter.mDetailLoadResultHandler.mDetailLoader.mHttpRequestHeaders = article.wapHeaders;
            String userAgent = !article.e() ? this.mCustomUserAgent : mOriginUserAgent;
            if (!android.support.design.a.isTextEmpty(userAgent)) {
                this.mPresenter.mDetailLoadResultHandler.mDetailLoader.mUserAgent = userAgent;
            }
        }
    }

    final String f(String arg13) {
        String v1 = android.support.design.a.isTextEmpty(arg13) ? this.aa() : NewArticleDetailFragment.i(arg13);
        String v4 = null;
        if (!android.support.design.a.isTextEmpty(v1)) {
            long v2 = 0;
            if (mArticle != null) {
                v2 = mArticle.groupId;
            }

            String v5 = v2 + "_" + v1;
            Object v0 = this.mImpressionListAdapterItemMap.get(v5);
            ImpressionListAdapter impressionListAdapter;
            if (v0 == null) {
                ImpressionListAdapterItem impressionListAdapterItem = new ImpressionListAdapterItem();
                impressionListAdapterItem.index = this.mImpressionListAdapterItemMap.size();
                String v0_2;
                if (mArticle != null) {
                    com.ss.android.article.base.utils.JSONObjectWrapper jsonObjectWrapper = new com.ss.android.article.base.utils.JSONObjectWrapper();
                    jsonObjectWrapper.put("item_id", mArticle.itemId);
                    jsonObjectWrapper.put("aggr_type", mArticle.aggrType);
                    v0_2 = jsonObjectWrapper.jsonObject.toString();
                } else {
                    v0_2 = v4;
                }

                impressionListAdapter = new ImpressionListAdapter(v2 + "_" + impressionListAdapterItem.index + "_" + v1, v0_2);
                impressionListAdapterItem.impressionListAdapter = impressionListAdapter;
                this.registerLifeCycleMonitor(impressionListAdapter);
                this.mImpressionListAdapterItemMap.put(v5, impressionListAdapterItem);
            } else {
                impressionListAdapter = ((ImpressionListAdapterItem) v0).impressionListAdapter;
            }

            if (impressionListAdapter == null) {
                return v4;
            }

            impressionListAdapter.a(this.ab());
            this.mImpressionListAdapter = impressionListAdapter;
            v4 = v5;
        }

        return v4;
    }

    final void checkAndReportLikeAndRewardsShow(NewDetailViewHolder newDetailViewHolder) {
        if (newDetailViewHolder != null
                && !newDetailViewHolder.isLikeAndRewardsShowReported
                && newDetailViewHolder.mNewDetailPageExtra != null
                && newDetailViewHolder.mNewDetailPageExtra.mLikeAndRewardsLayout != null
                && newDetailViewHolder.mNewDetailPageExtra.mArticleInfo != null) {
            int[] location = new int[2];
            newDetailViewHolder.mDetailScrollView.getLocationOnScreen(location);
            int positionOfScrollViewTail = location[1] + newDetailViewHolder.mDetailScrollView.getHeight();
            newDetailViewHolder.mNewDetailPageExtra.mLikeAndRewardsLayout.getLocationOnScreen(location);
            if (location[1] < 0) {
                return;
            }

            if (location[1] >= positionOfScrollViewTail) {
                return;
            }

            newDetailViewHolder.isLikeAndRewardsShowReported = true;
            JSONObject jsonObject = new JSONObject();
            try {
                jsonObject.put("item_id", this.mArticle.itemId);
                jsonObject.put("has_rewards", 0);
            } catch (JSONException jsonException) {
                jsonException.printStackTrace();
            }
            this.reportEvent("like_and_rewards_show", jsonObject);
        }
    }

    public final AbsArticle getArticle() {
        return this.mArticle;
    }

    private void onEvent(String event) {
        MobClickCombiner.onEvent(this.getContext(), "detail", event);
    }

    final void checkAndReportRelatedArticleShow(NewDetailViewHolder newDetailViewHolder) {
        long v4;
        long v8 = -1;
        if (newDetailViewHolder != null
                && !newDetailViewHolder.u
                && newDetailViewHolder.mNewDetailPageExtra != null
                && newDetailViewHolder.mNewDetailPageExtra.mArticleInfo != null
                && newDetailViewHolder.mNewDetailPageExtra.d != null) {
            int[] v0 = new int[2];
            newDetailViewHolder.mDetailScrollView.getLocationOnScreen(v0);
            int v1 = v0[1] + newDetailViewHolder.mDetailScrollView.getHeight();
            if (newDetailViewHolder.mNewDetailPageExtra.d == null) {
                return;
            }

            newDetailViewHolder.mNewDetailPageExtra.d.getLocationOnScreen(v0);
            if (v0[1] < 0) {
                return;
            }

            if (v0[1] >= v1) {
                return;
            }

            newDetailViewHolder.u = true;
            MobClickCombiner.onEvent(this.mContext, "detail", "related_article_show", this.itemId, 0);
            List v0_1 = newDetailViewHolder.mNewDetailPageExtra.mArticleInfo.Z;
            if (v0_1 == null) {
                return;
            }

            try {
                Iterator v10 = v0_1.iterator();
                while (true) {
                    if (!v10.hasNext()) {
                        return;
                    }

                    Object v0_3 = v10.next();
                    if (v0_3 == null) {
                        continue;
                    }

                    if (android.support.design.a.isTextEmpty(((ArticleInfo.RelatedNewsItem) v0_3).e)) {
                        continue;
                    }

                    Uri v0_4 = Uri.parse(AdsAppBaseActivity.b(((ArticleInfo.RelatedNewsItem) v0_3).e));
                    String v1_1 = v0_4.getHost();
                    if ("forum".equals(v1_1)) {
                        v1_1 = v0_4.getQueryParameter("fid");
                        v4 = android.support.design.a.isTextEmpty(v1_1) ? v8 : Long.valueOf(v1_1).longValue();
                        if (v4 == v8) {
                            v4 = Long.valueOf(v0_4.getQueryParameter("id")).longValue();
                        }

                        MobClickCombiner.onEvent(this.mContext, "forum_detail", "show_related", v4, this.itemId);
                        continue;
                    }

                    if (!"concern".equals(v1_1)) {
                        continue;
                    }

                    String cid = v0_4.getQueryParameter("cid");
                    long concernId = android.support.design.a.isTextEmpty(cid) ? v8 : Long.valueOf(cid).longValue();
                    MobClickCombiner.onEvent(this.mContext, "concern_page", "show_related", concernId, this.itemId);
                }

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public final long getArticleId() {
        return this.mNewDetailContext.adId;
    }

    public IVideoController getVideoController() {
        if (this.mVideoController == null && this.mTopVideoHolder != null) {
            if (VideoControllerSupplierProxy.getInstance().getVideoControllerInstance().isPauseFromList()) {
                this.mVideoController = VideoControllerSupplierProxy.getInstance().getVideoControllerInstance();
                VideoControllerSupplierProxy.getInstance().getVideoControllerInstance().reset(this.getContext(), this.mTopVideoHolder, false, null);
            } else {
                this.mVideoController = VideoControllerSupplierProxy.getInstance().createVideoController(this.getContext(), this.mTopVideoHolder, false, null);
            }

            this.mVideoController.setFullScreenListener(this.mVideoFullscreen);
            this.mVideoController.setOnCloseListener(this.mVideoCloseListener);
        }

        return this.mVideoController;
    }

    public final int getCommentMode() {
        return mArticle == null ? 0 : mArticle.getCommentMode();
    }

    private void h(NewDetailViewHolder newDetailViewHolder) {
        if (newDetailViewHolder != null) {
            if ((this.isActive()) && this.mArticle != null) {
                if (this.c == null || this.c.groupId != this.mArticle.groupId) {
                    this.P();
                    this.J = 0L;
                    this.c = new BaseArticle(this.mArticle.groupId, this.mArticle.itemId, this.mArticle.aggrType);
                }
                this.K = this.mNewDetailContext.adId;
                if (this.J > 0L) {
                    return;
                }
                this.J = System.currentTimeMillis();
            }
        }
    }

    private void playVideo(final String callbackId) {
        if (!NetworkUtils.isNetworkAvailable(this.mContext)) {
            this.onVideoClose();
            this.showImageToast(com.ss.android.article.browser.R.drawable.close_popup_textpage, com.ss.android.article.browser.R.string.net_unvailable);
        } else {
            if (!NetworkUtils.isWifi(this.mContext) && !AppData.getInstance().userAllowUseMobileNet) {
                final Context context = this.mContext;
                AlertDialog.Builder builder = com.ss.android.j.b.createDialogBuilder(context);
                final long adId = this.mNewDetailContext.adId;
                final long groupId = this.mArticle == null ? 0 : this.mArticle.groupId;
                builder.setMessage(com.ss.android.article.browser.R.string.video_mobile_play_dlg_content);
                builder.setPositiveButton(com.ss.android.article.browser.R.string.video_mobile_play, new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i) {
                        NewArticleDetailFragment.this.mAppData.userAllowUseMobileNet = true;
                        NewArticleDetailFragment.this.doPlayVideo(callbackId);
                        MobClickCombiner.onEvent(context, "video", "net_alert_confirm", groupId, adId);
                    }
                });
                builder.setNegativeButton(com.ss.android.article.browser.R.string.video_mobile_stop, new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i) {
                        MobClickCombiner.onEvent(context, "video", "net_alert_cancel", groupId, adId);
                    }
                });
                MobClickCombiner.onEvent(context, "video", "net_alert_show", groupId, adId);
                builder.setCancelable(false);
                builder.show();
                return;
            }

            this.doPlayVideo(callbackId);
        }
    }

    public final void onBack() {
        Object v0 = null;
        this.K();
        if (this.mNewDetailViewHolder != null
                && this.mNewDetailViewHolder.mWebView != null
                && this.mNewDetailViewHolder.mWebView.canGoBack()) {
            String url = this.mNewDetailViewHolder.mWebView.getUrl();
            if (url != null && url.startsWith("file:///android_asset/article/")) {
                this.finishPage();
                return;
            }

            if ((this.isWebViewDataLoaded) && !this.mNewDetailViewHolder.mWebView.canGoBackOrForward(-2)) {
                WebBackForwardList webbackForwardList = this.mNewDetailViewHolder.mWebView.copyBackForwardList();
                if (webbackForwardList != null
                        && webbackForwardList.getCurrentIndex() == 1
                        && ("about:blank".equals(webbackForwardList.getItemAtIndex(0).getUrl()))) {
                    this.finishPage();
                    return;
                }

                this.a(this.mNewDetailViewHolder, this.mArticle, this.mNewDetailContext.adId, true);
            } else {
                this.mNewDetailViewHolder.mWebView.goBack();
                this.mNewDetailViewHolder.mWebView.setTag(com.ss.android.article.browser.R.id.webview_transform_key, v0);
                this.showCloseAllWebpageIv();
            }

            this.mNewDetailViewHolder.mDetailScrollView.handOpenDrawer();
            this.onEvent(this.isClickBackBtn ? "page_back_button" : "page_back_key");
            this.isClickBackBtn = false;
        } else {
            this.finishPage();
        }
    }

    public void handleMsg(Message message) {
        Article v3;
        String v1_1;
        if (!this.isViewValid()) {
            return;
        }

        if (this.mDetailHelper != null && (this.mDetailHelper.handleMsg(message))) {
            return;
        }

        AppData.isNightMode();
        switch (message.what) {
            case 14: {
                this.hideProgressBar();
                return;
            }
            case 17: {
                if (this.mNewDetailViewHolder == null) {
                    return;
                }

                if (this.mNewDetailViewHolder.mWapStatHelper.a) {
                    return;
                }

                if (this.mArticle == null) {
                    return;
                }

                if (this.mArticle.ignoreWebTransform) {
                    return;
                }

                this.as = true;
                this.mArticle.articleType = 0;
                if (this.mArticle != null) {
                    v1_1 = this.mArticle.getItemKey();
                    v3 = this.mArticle;
                } else {
                    String v0_1 = Article.a(this.itemId, this.articleGroupItemId);
                    v3 = new Article(this.itemId, this.articleGroupItemId, this.mArticleAggrType);
                    v1_1 = v0_1;
                }

                if (!NetworkUtils.isNetworkAvailable(this.getActivity())) {
                    this.Q();
                } else {
                    this.mPresenter.mDetailLoadResultHandler.loadArticleDetail(v1_1, this.mArticle, v3, false, new DetailLoadResultHandler.ResultListener<Article, ArticleDetail>() {

                        @Override
                        public void onResult(Article arg1, ArticleDetail arg2) {
                            if (NewArticleDetailFragment.this.mPresenter.hasView()) {
                                ((NewDetailView) NewArticleDetailFragment.this.mPresenter.mView).showContent(arg2);

                            }
                        }
                    });
                }

                JSONObject jsonObject = new JSONObject();
                try {
                    jsonObject.put("item_id", this.mArticle.itemId);
                    jsonObject.put("aggr_type", this.mArticle.aggrType);
                } catch (Exception exception) {
                }

                MobClickCombiner.onEvent(this.mContext, "detail", "transcode_start", this.mArticle.groupId, 0, jsonObject);
                return;
            }
            case 1003: {
                boolean v1 = true;
                if (!(message.obj instanceof CommentFetcher)) {
                    return;
                }

                onCommentLoaded((CommentFetcher) message.obj, v1);
                return;
            }
            case 1004: {
                boolean v2 = false;
                if (!(message.obj instanceof CommentFetcher)) {
                    return;
                }

                onCommentLoaded((CommentFetcher) message.obj, v2);
                return;
            }
            case 10001: {
                this.showImageToast(com.ss.android.article.browser.R.drawable.doneicon_popup_textpage, com.ss.android.article.browser.R.string.toast_report_ok);
                return;
            }
            case 10002: {
                this.showImageToast(com.ss.android.article.browser.R.drawable.close_popup_textpage, com.ss.android.article.browser.R.string.toast_report_fail);
                return;
            }
            case 10011: {
                if (this.isActive()) {
                    return;
                }

                if (this.mNewDetailViewHolder == null) {
                    return;
                }

                try {
                    this.mNewDetailViewHolder.mWebView.getSettings().setBlockNetworkLoads(true);
                } catch (Exception v0) {
                }

                return;
            }
        }
        return;
    }

    public final int i() {
        int v0_1;
        int v2 = 0;
        Object v1 = null;
        Iterator v3 = this.aT.values().iterator();
        while (v3.hasNext()) {
            Object v0 = v3.next();
            if (((NewArticleDetailFragment$a) v0).e != 0) {
                v0 = v1;
            }

            v1 = v0;
        }

        if (v1 == null || ((NewArticleDetailFragment$a) v1).url == null || this.mArticle == null) {
            v0_1 = 0;
            v2 = v0_1;
        } else {
            if (!((NewArticleDetailFragment$a) v1).url.startsWith("file:///android_asset/article/")
                    && !MediaAppUtil.a(((NewArticleDetailFragment$a) v1).url, this.mArticle.articleUrl)) {
                return 0;
            }

            v0_1 = this.getSwipeOverlayHeight();
            int v1_1 = this.getContentHeight();
            if (v1_1 == 0) {
                return v2;
            }

            NewArticleDetailFragment$a v3_1 = this.J();
            if (v3_1 == null) {
                return v2;
            }
            return Math.round(Math.max(v3_1.precentage, (((float) (v0_1 + v3_1.maxscrollheight))) / (((float) v1_1))) * 100f);
        }
        return v2;
    }

    public void initVideoView() {
    }

    public boolean isStreamTab() {
        return false;
    }

    public final long j() {
        return this.J < 0 ? -1 : System.currentTimeMillis() - this.J;
    }

    public final int k() {
        return 0;
    }

    public final void disableOverlaySwipe() {
        if (this.mSwipeOverlayFrameLayout != null) {
            this.mSwipeOverlayFrameLayout.setSwipeEnabled(false);
        }
    }

    final void finishPage() {
        if (this.mVideoController == null || !this.mVideoController.backPress(this.getActivity())) {
            boolean delayFinish = Build.VERSION.SDK_INT == 19
                    && !this.u
                    && this.mPresenter.mNewDetailContext.hasArticleUrl()
                    && this.mPresenter.mNewDetailContext.adId <= 0
                    && (!this.mAppData.getAppSettings().disabledDelayFinish());
            if (delayFinish) {
                this.mPostDelayFinishTs = System.currentTimeMillis();
                LoadUrlUtils.loadUrl(this.mNewDetailViewHolder.mWebView, "about:blank");
                this.mWeakHandler.removeCallbacks(this.mDelayFinishRunnable);
                this.mWeakHandler.postDelayed(this.mDelayFinishRunnable, 100);
                return;
            }

            this.showCloseAllWebpageIv();
            String type;
            if (this.isUserSwipeBack) {
                type = "back_gesture";
            } else if (this.isCloseButtonClick) {
                type = "close_button";
            } else if (this.isClickBackBtn) {
                type = "page_back_button";
            } else {
                type = "back_key";
            }

            this.at.put("type", type);
            this.isClickBackBtn = false;
            if (!this.isFinishing()) {
                ((NewDetailActivity) this.getActivity()).finishPage();
            }
        }
    }

    public final void n() {
        if (this.mNewDetailContext != null && this.mNewDetailContext.article != null) {
            Article article = this.mNewDetailContext.article;
            this.mArticle = article;
            this.mNewDetailContext.article = article;
            if (this.mArticle != null && this.mArticle.groupId > 0L) {
                this.mAppData.a(this.mArticle);
            }

            this.itemId = this.mArticle.groupId;
            this.articleGroupItemId = this.mArticle.itemId;
            this.mArticleAggrType = this.mArticle.aggrType;
            this.mCategoryName = this.mNewDetailContext.categoryName;
            this.mLogExtra = this.mNewDetailContext.logExtra;
            this.mArticleUrl = this.mNewDetailContext.articleUrl;
            this.mItemId = this.mNewDetailContext._itemId;
            this.mCommentId = this.mNewDetailContext.commentId;
            if (this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mNewDetailAdapter != null) {
                this.mNewDetailViewHolder.mNewDetailAdapter.mArticle = this.mArticle;
            }

            if (this.mNewDetailViewHolder != null) {
                this.setUserAgent(this.mArticle, this.mNewDetailViewHolder.mWebView);
            }

            this.maybeReplaceUserAgent(this.mArticle);
            if (!this.mAppData.mDisableWebTransform && this.mNewDetailContext.adId <= 0L) {
                float v0_1 = this.mAppData.webTransformDelaySecFloat;
                if (this.mArticle != null && (this.mArticle.hasArticleUrl()) && !this.mArticle.ignoreWebTransform && v0_1 > 1f) {
                    this.mWeakHandler.sendEmptyMessageDelayed(17, ((long) (v0_1 * 1000f)));
                }
            }

            if (this.mNewDetailViewHolder != null) {
                if (this.mArticle != null && (this.mArticle.delete)) {
                    if (!this.isFinishing()) {
                        ((NewDetailActivity) this.getActivity()).switchToArticleDeleted(this.mArticle);
                    }
                } else {
                    long v0_2 = this.itemId;
                    mNewDetailViewHolder.mNewDetailPageExtra.setArticle(this.mArticle);
                    if (this.mArticle != null) {
                        v0_2 = this.mArticle.groupId;
                    }

                    if (v0_2 > 0L) {
                        mNewDetailViewHolder.mNewDetailAdapter.e = String.valueOf(v0_2);
                    }

                    if (this.mArticle != null && this.mArticle.groupId == this.mItemId && this.mItemId > 0L) {
                        mNewDetailViewHolder.everEnterComment = true;
                        mNewDetailViewHolder.mDetailScrollView.setShowBottomViewOnFirstLayout(true);
                    }

                    this.a(mNewDetailViewHolder, this.mArticle, this.mNewDetailContext.adId, false);
                    this.footerAdaptNightMode(mNewDetailViewHolder, AppData.isNightMode());
                    this.setDisableScrollOver(this.mArticle);
                    this.handleExtraPage();
                    this.V();
                }
            }
            this.O();
        }
    }

    public final Fragment getFragment() {
        return this;
    }

    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (com.ss.android.account.o.isRepeatBindError(requestCode, resultCode, data)) {
            this.ae = true;
        } else if (requestCode == 1003) {
            this.mDetailHelper.c();
        } else if (100 == requestCode && -1 == resultCode && data != null) {
            long commentId = data.getLongExtra("comment_id", 0);
            if (this.mNewDetailViewHolder != null && (this.mNewDetailViewHolder.mCommentTabCache.removeCommnet(commentId))) {
                this.mNewDetailViewHolder.mNewDetailAdapter.addAllComment(this.mNewDetailViewHolder.mCommentTabCache.mArticleTabComments[0].commentWrapperList);
                this.mNewDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                --this.mArticle.commentCount;
                this.initDetailTitleBar(this.mArticle);
                this.showCommentListOrSofa(this.mNewDetailViewHolder, this.mNewDetailViewHolder.mCommentTabCache);
            }
        }
    }

    public void onCreate(Bundle savedInstanceState) {
        this.mNewDetailViewHolder = new NewDetailViewHolder();
        super.onCreate(savedInstanceState);
    }

    @Nullable
    public View onCreateView(LayoutInflater layoutInflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        SubscriptionRouter.addSubscriber(this);
        return super.onCreateView(layoutInflater, container, savedInstanceState);
    }

    public void onDestroy() {
        super.onDestroy();
        if ((this.mAppData.getAbSettings().isEnableArticleRecord()) && this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mWebView != null && this.mArticle != null) {
            if (this.isNovel()) {
                String bookId = this.mNewDetailContext.articleDetail.novelData.getBookId();
                String itemKey = this.mArticle.getItemKey();
                int articlePosition = this.articlePosition;
                if (articlePosition > 0 && !android.support.design.a.isTextEmpty(bookId) && !android.support.design.a.isTextEmpty(itemKey)) {
                    mRecordManager.serialRecordMap.put(bookId, new RecordManager.NovelReadPositionRecord(itemKey, articlePosition));
                }
                RecordManager.reportReadPosition(this.mArticle.itemId, this.articlePosition);
            } else {
                String itemKey = this.mArticle.getItemKey();
                int articlePosition = this.articlePosition;
                if (articlePosition >= 0
                        && !android.support.design.a.isTextEmpty(itemKey)
                        && (articlePosition != 0 || mRecordManager.articleReadPositionRecordMap.containsKey(itemKey))) {
                    mRecordManager.articleReadPositionRecordMap.put(itemKey, Integer.valueOf(articlePosition));
                }
            }
        }
        Iterator<Map.Entry<String, ImpressionListAdapterItem>> iterator = this.mImpressionListAdapterItemMap.entrySet().iterator();
        while (iterator.hasNext()) {
            ImpressionListAdapterItem item = iterator.next().getValue();
            if (item == null) {
                continue;
            }

            if (item.index < 0) {
                continue;
            }

            ImpressionListAdapter impressionListAdapter = item.impressionListAdapter;
            if (impressionListAdapter == null) {
                continue;
            }

            com.ss.android.action.b.b v2_2 = impressionListAdapter.b;
            if (v2_2 == null) {
                continue;
            }
            ImpressionHelper.getInstance().a(v2_2, impressionListAdapter.a);
        }
        CallbackCenter.removeCallback(BaseAppData.callbackTypeAddArticleCommentFromUpdate, this.addArticleCommentFromUpdateCallback);
        CallbackCenter.removeCallback(BaseAppData.callbackTypeArticleSubOrUnsub, this.articleSubOrUnsubCallback);
        this.mAppData.b(this.mArticle);
        VideoControllerSupplierProxy.getInstance().getVideoControllerInstance().clearOnCloseListener();
        if (mNewDetailViewHolder != null) {
            if (mNewDetailViewHolder.mNewDetailAdapter != null) {
                mNewDetailViewHolder.mNewDetailAdapter.onDestroy();
            }

            if (this.mArticle != null) {
                mNewDetailViewHolder.mWapStatHelper.reportJumpCount(this.getActivity(), this.mNewDetailContext.adId, this.mLogExtra);
                mNewDetailViewHolder.mWapStatHelper.reportJumpLinks(this.getActivity(), this.mNewDetailContext.adId, this.mLogExtra);
            }

            WebViewTweaker.clearWebviewOnDestroy(mNewDetailViewHolder.mWebView);
        }

        ImageProvider.remoteOnRemoteImageLoadedListener(this);
        if (this.isDetailCommentsShowReported) {
            this.mAppData.loginCommentFirst = false;
        }

        this.mWeakHandler.removeCallbacksAndMessages(null);
        ActivityStackManager.removeActivity(ActivityStackManager.Type.DETAIL_ACTIVITY, ((NewDetailActivity) this.getActivity()));
        if (this.mVideoController != null) {
            this.mVideoController.unRegisterReceiver();
        }
    }

    public void onDestroyView() {
        if (this.mWebContainer != null) {
            AccountAnimatorHelper.clearAnimation(this.mWebContainer);
        }
        super.onDestroyView();
        SubscriptionRouter.removeSubscriber(this);
    }

    public void onPause() {
        JSONObject v7 = null;
        long v12 = 0;
        IVideoController v6 = null;
        super.onPause();
        if (this.mNewDetailViewHolder.mWebView != null) {
            LoadUrlUtils.loadUrl(this.mNewDetailViewHolder.mWebView, "javascript:window.on_page_disappear&&on_page_disappear()");
        }

        if (this.mVideoController != null && (this.mVideoController.isVideoVisible())) {
            this.mVideoController.releaseMedia();
            this.mVideoController = null;
            this.onVideoClose();
        }

        this.K();
        NewDetailViewHolder v0 = this.mNewDetailViewHolder;
        Article v3 = this.mArticle;
        if (this.I) {
            if (v0 != null && v3 != null && (v0.m) && this.c != null && v3.groupId == this.c.groupId) {
                this.P();
            }

            this.J = v12;
            this.c = null;
            this.K = v12;
            this.c(v3);
            if (this.at == null) {
            } else {
                this.at.put("read_pct", String.valueOf(this.i()));
                this.at.put("page_count", String.valueOf(this.ab()));
                this.a(this.at);
                this.at.clear();
            }
        }
        this.mAppData.d(false);
        this.Q();
        if ((this.isFinishing()) && v3 != null && v0 != null && (v3.hasArticleUrl())) {
            try {
                v7 = new JSONObject();
                v7.put("article_type", v3.articleType);
                if (android.support.design.a.isTextEmpty(this.mLogExtra)) {
//                    goto label_76;
                } else {

                    v7.put("log_extra", this.mLogExtra);
                }
            } catch (JSONException v1) {
            }

            label_76:
            v0.mWapStatHelper.a(v0.mWebView, v3, this.mNewDetailContext.adId, null, v7);
        }

        if (v0 != null) {
            v0.mNewDetailAdapter.onPause();
            if (v0.mNewDetailPageExtra != null) {
                v0.mNewDetailPageExtra.e();
            }

            WebViewPauseResumeCompat.onPause(v0.mWebView);
            WebViewTweaker.tweakPauseIfFinishing(this.mContext, v0.mWebView);
            if (this.isFinishing()) {
                v0.mWebView.getSettings().setJavaScriptEnabled(false);
                return;
            }

            this.mWeakHandler.sendEmptyMessageDelayed(10011, 120000);
        }
    }

    @Subscriber
    public void onPayCallback(com.ss.android.article.base.feature.detail2.event.a arg5) {
        if (arg5.a == 0 && (this.mSpipe.isLogin)) {
            UserInfo v0 = new UserInfo(this.mSpipe.userId);
            v0.avatarUrl = this.mSpipe.avatarUrl;
            v0.userVerified = this.mSpipe.userVerified;
            this.mNewDetailViewHolder.mNewDetailPageExtra.a(v0);
        }
    }

    public void onResume() {
        super.onResume();
        if (mNewDetailViewHolder != null) {
            this.mWeakHandler.removeMessages(10011);
            mNewDetailViewHolder.mWebView.getSettings().setBlockNetworkLoads(false);
            if (!this.Z && mNewDetailViewHolder.mNewDetailPageExtra != null) {
                mNewDetailViewHolder.mNewDetailPageExtra.c();
            }
        }

        if (this.Z) {
            this.Z = false;
            if ((this.mDisableDetailFragmentPreload) && this.mNewDetailViewHolder.mDetailScrollView.getParent() == null) {
                this.mWebContainer.addView(this.mNewDetailViewHolder.mDetailScrollView);
            }

            if (this.mNewDetailContext.fromNotification) {
                JSONObject jsonObject = new JSONObject();
                try {
                    jsonObject.put("item_id", this.articleGroupItemId);
                    jsonObject.put("aggr_type", this.mArticleAggrType);
                } catch (Exception exception) {
                }

                this.getContext();
                AppLog.onEvent("apn", "notice", null, this.itemId, 0, jsonObject);
            }

            if (this.mAppData.getAppSettings().disableDetailFragmentPreload()) {
                this.n();
            }
        } else {
            this.O();
        }
        if (this.isActive()) {
            boolean isNightMode = AppData.isNightMode();
            if (isNightMode != this.mIsNightMode) {
                if (this.mNewDetailViewHolder.mNewDetailPageExtra != null) {
                    this.mNewDetailViewHolder.mNewDetailPageExtra.d();
                }
                if (this.mNoNetView != null) {
                    this.mNoNetView.initNoDataActionBtn();
                }

                this.mIsNightMode = isNightMode;
                this.mDetailHelper.notifyViewAdaptNightMode();
                com.ss.android.article.base.feature.detail2.config.a.a(this.mRootView, this.mResources.getColor(com.ss.android.article.browser.R.color.ssxinmian4));
                String setDayModeJs = isNightMode ? "javascript: TouTiao.setDayMode(0)" : "javascript: TouTiao.setDayMode(1)";
                if (mNewDetailViewHolder != null) {
                    if (!mNewDetailViewHolder.hasArticleUrl(mArticle) || mArticle != null && (mArticle.d())) {
                        this.mNewDetailViewHolder.mWebView.setBackgroundColor(this.mResources.getColor(com.ss.android.article.browser.R.color.ssxinmian4));
                        LoadUrlUtils.loadUrl(mNewDetailViewHolder.mWebView, setDayModeJs);
                        Logger.d(NewArticleDetailFragment.TAG, setDayModeJs);
                    }

                    this.footerAdaptNightMode(mNewDetailViewHolder, isNightMode);
                    this.V();
                    mNewDetailViewHolder.mNewDetailAdapter.notifyDataSetChanged();
                }

                if (this.mSerialCatalogView != null) {
                    Resources resources = mSerialCatalogView.getResources();
                    mSerialCatalogView.mPreChapterTv.setTextColor(resources.getColorStateList(com.ss.android.article.browser.R.color.novel_catalog_text_color));
                    mSerialCatalogView.mNextChapterTv.setTextColor(resources.getColorStateList(com.ss.android.article.browser.R.color.novel_catalog_text_color));
                    mSerialCatalogView.mCatalogTv.setTextColor(resources.getColorStateList(com.ss.android.article.browser.R.color.novel_catalog_text_color));
                    mSerialCatalogView.mCatalogDividerView.setBackgroundColor(resources.getColor(com.ss.android.article.browser.R.color.ssxinxian1));
                    mSerialCatalogView.setBackgroundColor(resources.getColor(com.ss.android.article.browser.R.color.ssxinmian4));
                }
            }
        }
        this.mFontSizePref = this.mAppData.mFontSizePref;
        if (mNewDetailViewHolder != null && mNewDetailViewHolder.mNewDetailAdapter != null) {
            mNewDetailViewHolder.mNewDetailAdapter.onResume();
            WebViewPauseResumeCompat.onResume(mNewDetailViewHolder.mWebView);
        }

        if (this.ae) {
            Spipe.loginDupAlert(this.getActivity());
        } else {
            SplashAdActivity.a(this.getContext(), this.mFromNotification);
            this.mFromNotification = false;
        }

        this.ae = false;
    }

    public void onStop() {
        super.onStop();
        if (this.mNewDetailViewHolder != null && this.mNewDetailViewHolder.mNewDetailAdapter != null) {
            this.mNewDetailViewHolder.mNewDetailAdapter.onStop();
        }

        if (this.mNoNetView != null) {
            this.mNoNetView.b();
        }

        if (this.mRecordManager != null) {
            this.mRecordManager.saveRecord(false);
        }
    }

    @Subscriber
    public void onThumbPreviewStatusChanged(ThumbPreviewStatusEvent thumbPreviewStatusEvent) {
        NewDetailViewHolder v0;
        long v6 = 0;
        if (thumbPreviewStatusEvent != null && !this.I) {
            if (thumbPreviewStatusEvent.a == 0) {
                v0 = this.mNewDetailViewHolder;
                Article v6_1 = this.mArticle;
                long v8 = this.mNewDetailContext.adId;
                if (v6_1 != null && v0 != null && (v0.m)) {
                    this.J = System.currentTimeMillis();
                    this.c = new BaseArticle(v6_1.groupId, v6_1.itemId, v6_1.aggrType);
                    this.K = v8;
                }
            } else if (thumbPreviewStatusEvent.a == 1) {
                v0 = this.mNewDetailViewHolder;
                Article v1 = this.mArticle;
                if (v0 != null && v1 != null && (v0.m) && this.c != null && v1.groupId == this.c.groupId) {
                    this.P();
                }

                this.J = v6;
                this.c = null;
                this.K = v6;
                this.c(v1);
                if (this.at == null) {
                    return;
                }

                this.at.put("read_pct", String.valueOf(this.i()));
                this.at.put("page_count", String.valueOf(this.ab()));
                this.a(this.at);
                this.at.clear();
            }
        }
    }

    public void onViewCreated(View view, Bundle bundle) {
        super.onViewCreated(view, bundle);
        if (this.mDetailArticleMonitorFPS == null && (com.bytedance.article.common.a.g.a())) {
            this.mDetailArticleMonitorFPS = new MonitorFPS(this.getContext(), "detail_article");
        }

        if (this.DetailArticleCommentMonitorFPS == null && (com.bytedance.article.common.a.g.a())) {
            this.DetailArticleCommentMonitorFPS = new MonitorFPS(this.getContext(), "detail_article_comment");
        }
    }

    final boolean p() {
        boolean v0 = true;
        int v1 = this.getCommentMode();
        if (v1 != 1 && v1 != 2) {
            v0 = false;
        }

        return v0;
    }

    final int getSwipeOverlayHeight() {
        return this.mSwipeOverlayFrameLayout == null ? 0 : this.mSwipeOverlayFrameLayout.getHeight();
    }

    public final void r() {
        if (mArticle != null) {
            if (mArticle.mBanComment) {
                if (!this.isFinishing()) {
                    ((NewDetailActivity) this.getActivity()).setWriteCommentEnabled(false);
                }
            } else if (this.mDetailHelper != null) {
                this.mDetailHelper.a("", 0, true);
                this.aG = 0;
            }
        }
    }

    public final void cleanFavorIvAnimation() {
        if (!this.isFinishing()) {
            ((NewDetailActivity) this.getActivity()).cleanFavorIvAnimation();
        }
    }

    public final IComponent getComponent() {
        return this;
    }

    public final SSPage getSSPage() {
        return this;
    }

    public final String v() {
        return "article_detail_favor";
    }

    public final ArticleInfo getArticleInfo() {
        return this.mNewDetailViewHolder == null
                || this.mNewDetailViewHolder.mNewDetailPageExtra == null
                ? null
                : this.mNewDetailViewHolder.mNewDetailPageExtra.mArticleInfo;
    }

    final void onVideoClose() {
        try {
            if (android.support.design.a.isTextEmpty(this.aq)) {
                LoadUrlUtils.loadUrl(mNewDetailViewHolder.mWebView, "javascript:appCloseVideoNoticeWeb(\'" + this.mVid + "\')");
            } else {
                LoadUrlUtils.loadUrl(mNewDetailViewHolder.mWebView, "javascript:appCloseVideoNoticeWeb(\'" + this.aq + "\')");
            }

            if (this.isFinishing()) {
                return;
            }

            if (this.getCommentMode() == 0) {
                ((NewDetailActivity) this.getActivity()).setDetailToolBarVisible(true);
            }

            if (((NewDetailActivity) this.getActivity()).mDetailTitleBar.getVisibility() != View.GONE) {
                return;
            }

            ((NewDetailActivity) this.getActivity()).setDetailTitleBarVisible(true);
            if (this.mNewDetailViewHolder == null) {
                return;
            }

            if (this.mNewDetailViewHolder.mWebView == null) {
                return;
            }

            this.mNewDetailViewHolder.mWebView.getLayoutParams().height = this.mNewDetailViewHolder.mWebView.getLayoutParams().height - this.getDetailTitleBarHeight();
            this.mNewDetailViewHolder.mWebView.requestLayout();
        } catch (Exception exception) {
        }
    }

    public final void onBackClick() {
        this.isClickBackBtn = true;
        this.onBack();
    }

    public final void onTopMoreTitleClick() {
    }

    @Retention(value = RetentionPolicy.SOURCE)
    public @interface APPEAR_STATUS {

    }

    final class NewArticleDetailFragment$a {
        public String url;
        public int screencount;
        public int maxscrollheight;
        public float precentage;
        public int e;

        private NewArticleDetailFragment$a() {
            this.e = 0;
        }

        public final String toString() {
            return "url = " + this.url
                    + ", screencount = " + this.screencount
                    + ", precentage = " + this.precentage
                    + ", maxscrollheight = " + this.maxscrollheight;
        }
    }

    final class ImpressionListAdapterItem {
        int index;
        ImpressionListAdapter impressionListAdapter;
    }

    final class Footer extends AbstractFooter {

        public Footer(View view) {
            super(view);
        }

        public final void onUserClick() {
            if (NewArticleDetailFragment.this.mNewDetailViewHolder != null) {
                NewArticleDetailFragment.this.createCommentTabCache(NewArticleDetailFragment.this.itemId, NewArticleDetailFragment.this.mNewDetailViewHolder);
                NewArticleDetailFragment.this.enterComment();
            }
        }

        public final void switchToLoading() {
            super.switchToLoading();
            if (NewArticleDetailFragment.this.mNoNetView != null) {
                NewArticleDetailFragment.this.mNoNetView.setVisibility(View.GONE);
            }
        }
    }
}

